target: unlock on error path in configfs
Subsystems (3)
PATCH 2/2 target: unlock on error path in configfs
If the user wrote a wrong value to the file the it would lead to a dead lock eventually.
Signed-off-by Dan Carpenter <[email protected]>
drivers/target/target_core_configfs.c +1 -0
@@ -660,6 +660,7 @@ static ssize_t target_core_dev_store_attr_##_name( \ } \ ret =strict_strtoul (page,0 , &val); \if (ret <0 ) { \ +spin_unlock (&se_dev->se_dev_lock); \printk (KERN_ERR "strict_strtoul() failed with" \" ret: %d\n" , ret); \return -EINVAL ; \
Quoted 3 lines · Dan Carpenter
If the user wrote a wrong value to the file the it would lead to a dead lock eventually.
Good catch on this one. Commited as 827447968 and pushed into lio-core-2.6.git.
Thanks!
--nab
Quoted 14 lines
Signed-off-by Dan Carpenter <[email protected]>drivers/target/target_core_configfs.c +1
-0@@ -660,6 +660,7 @@ static ssize_t target_core_dev_store_attr_##_name( \ } \ ret =strict_strtoul (page,0 , &val); \if (ret <0 ) { \ +spin_unlock (&se_dev->se_dev_lock); \printk (KERN_ERR "strict_strtoul() failed with" \" ret: %d\n" , ret); \return -EINVAL ; \