summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/osd/osd_uld.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-03-23 13:41:42 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2017-03-27 21:55:14 -0400
commit03b1a06203a1f283ad8a20dce78f0f5f17eaeb88 (patch)
treeb34f4746803ce059f30c053d612f13aa53f17469 /drivers/scsi/osd/osd_uld.c
parent16a20b52d1b0c900ea2e7363cf6e10267a445002 (diff)
downloadlinux-03b1a06203a1f283ad8a20dce78f0f5f17eaeb88.tar.bz2
scsi: osd_uld: remove an unneeded NULL check
We don't call the remove() function unless probe() succeeds so "oud" can't be NULL here. Plus, if it were NULL, we dereference it on the next line so it would crash anyway. [mkp: applied by hand] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Boaz Harrosh <ooo@electrozaur.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/osd/osd_uld.c')
-rw-r--r--drivers/scsi/osd/osd_uld.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/osd/osd_uld.c b/drivers/scsi/osd/osd_uld.c
index e0ce5d2fd14d..c3563a9512b7 100644
--- a/drivers/scsi/osd/osd_uld.c
+++ b/drivers/scsi/osd/osd_uld.c
@@ -524,10 +524,9 @@ static int osd_remove(struct device *dev)
struct scsi_device *scsi_device = to_scsi_device(dev);
struct osd_uld_device *oud = dev_get_drvdata(dev);
- if (!oud || (oud->od.scsi_device != scsi_device)) {
- OSD_ERR("Half cooked osd-device %p,%p || %p!=%p",
- dev, oud, oud ? oud->od.scsi_device : NULL,
- scsi_device);
+ if (oud->od.scsi_device != scsi_device) {
+ OSD_ERR("Half cooked osd-device %p, || %p!=%p",
+ dev, oud->od.scsi_device, scsi_device);
}
device_unregister(&oud->class_dev);