[PATCH 3/3] dm ioctl: Delete an unnecessary check before the function call "dm_table_destroy"

From: SF Markus Elfring
Date: Mon Feb 02 2015 - 10:23:39 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 2 Feb 2015 15:30:37 +0100

The dm_table_destroy() function tests whether its argument is NULL and then
returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/md/dm-ioctl.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index 73f791b..4fac6cf 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -1053,8 +1053,7 @@ static int do_resume(struct dm_ioctl *param)
* Since dm_swap_table synchronizes RCU, nobody should be in
* read-side critical section already.
*/
- if (old_map)
- dm_table_destroy(old_map);
+ dm_table_destroy(old_map);

if (!r)
__dev_status(md, param);
--
2.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/