summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorBart Van Assche <bart.vanassche@sandisk.com>2017-03-18 01:02:03 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2017-03-19 18:16:37 +0100
commit0aeccdfe220c360ab888816da06b8eb67d910ff6 (patch)
treece2f86fff0cefca61b328c9d2e9b038dc3def3b8 /drivers/scsi/device_handler
parentscsi: scsi_dh_alua: Ensure that alua_activate() calls the completion function (diff)
downloadlinux-0aeccdfe220c360ab888816da06b8eb67d910ff6.tar.xz
linux-0aeccdfe220c360ab888816da06b8eb67d910ff6.zip
scsi: scsi_dh_alua: Warn if the first argument of alua_rtpg_queue() is NULL
Callers must provide a valid port group to alua_rtpg_queue(). Issue a kernel warning if that is not the case. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Cc: Hannes Reinecke <hare@suse.de> Cc: Tang Junhui <tang.junhui@zte.com.cn> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index b6849d3ecefe..c01b47e5b55a 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -876,7 +876,7 @@ static bool alua_rtpg_queue(struct alua_port_group *pg,
unsigned long flags;
struct workqueue_struct *alua_wq = kaluad_wq;
- if (!pg || scsi_device_get(sdev))
+ if (WARN_ON_ONCE(!pg) || scsi_device_get(sdev))
return false;
spin_lock_irqsave(&pg->lock, flags);