aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwspinlock
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2012-09-10 00:52:02 -0400
committerOhad Ben-Cohen <ohad@wizery.com>2012-09-10 06:19:25 -0400
commite352614cd3e7a5f7af7cff894a3b5a705181de21 (patch)
tree5f2ddc609cdd1e54c59f638af6a3f890aa81da0d /drivers/hwspinlock
parent55d512e245bc7699a8800e23df1a24195dd08217 (diff)
hwspinlock/core: move the dereference below the NULL test
The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'drivers/hwspinlock')
-rw-r--r--drivers/hwspinlock/hwspinlock_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwspinlock/hwspinlock_core.c b/drivers/hwspinlock/hwspinlock_core.c
index 1201a15784c3..db713c0dfba4 100644
--- a/drivers/hwspinlock/hwspinlock_core.c
+++ b/drivers/hwspinlock/hwspinlock_core.c
@@ -552,7 +552,7 @@ EXPORT_SYMBOL_GPL(hwspin_lock_request_specific);
552 */ 552 */
553int hwspin_lock_free(struct hwspinlock *hwlock) 553int hwspin_lock_free(struct hwspinlock *hwlock)
554{ 554{
555 struct device *dev = hwlock->bank->dev; 555 struct device *dev;
556 struct hwspinlock *tmp; 556 struct hwspinlock *tmp;
557 int ret; 557 int ret;
558 558
@@ -561,6 +561,7 @@ int hwspin_lock_free(struct hwspinlock *hwlock)
561 return -EINVAL; 561 return -EINVAL;
562 } 562 }
563 563
564 dev = hwlock->bank->dev;
564 mutex_lock(&hwspinlock_tree_lock); 565 mutex_lock(&hwspinlock_tree_lock);
565 566
566 /* make sure the hwspinlock is used */ 567 /* make sure the hwspinlock is used */