diff options
author | Jens Axboe <axboe@kernel.dk> | 2013-04-04 03:03:41 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-04-04 03:03:41 -0400 |
commit | c66bb3f075cfe2d17b2427e96e043622db02759c (patch) | |
tree | 7341df82d88498de19f21ae55e13b6d51c6ec057 /drivers/block | |
parent | 0caff00390db41c98976e65f2ebc3eeaa4861358 (diff) |
mtip32xx: fix two smatch warnings
Dan reports:
New smatch warnings:
drivers/block/mtip32xx/mtip32xx.c:2728 show_device_status() warn: variable dereferenced before check 'dd' (see line 2727)
drivers/block/mtip32xx/mtip32xx.c:2758 show_device_status() warn: variable dereferenced before check 'dd' (see line 2757)
which are checking if dd == NULL, in a list_for_each_entry() type loop.
Get rid of the check, dd can never be NULL here.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 8517af8c0fcb..32c678028e53 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
@@ -2725,7 +2725,7 @@ static ssize_t show_device_status(struct device_driver *drv, char *buf) | |||
2725 | spin_lock_irqsave(&dev_lock, flags); | 2725 | spin_lock_irqsave(&dev_lock, flags); |
2726 | size += sprintf(&buf[size], "Devices Present:\n"); | 2726 | size += sprintf(&buf[size], "Devices Present:\n"); |
2727 | list_for_each_entry_safe(dd, tmp, &online_list, online_list) { | 2727 | list_for_each_entry_safe(dd, tmp, &online_list, online_list) { |
2728 | if (dd && dd->pdev) { | 2728 | if (dd->pdev) { |
2729 | if (dd->port && | 2729 | if (dd->port && |
2730 | dd->port->identify && | 2730 | dd->port->identify && |
2731 | dd->port->identify_valid) { | 2731 | dd->port->identify_valid) { |
@@ -2755,7 +2755,7 @@ static ssize_t show_device_status(struct device_driver *drv, char *buf) | |||
2755 | 2755 | ||
2756 | size += sprintf(&buf[size], "Devices Being Removed:\n"); | 2756 | size += sprintf(&buf[size], "Devices Being Removed:\n"); |
2757 | list_for_each_entry_safe(dd, tmp, &removing_list, remove_list) { | 2757 | list_for_each_entry_safe(dd, tmp, &removing_list, remove_list) { |
2758 | if (dd && dd->pdev) { | 2758 | if (dd->pdev) { |
2759 | if (dd->port && | 2759 | if (dd->port && |
2760 | dd->port->identify && | 2760 | dd->port->identify && |
2761 | dd->port->identify_valid) { | 2761 | dd->port->identify_valid) { |