Skip to content

Commit

Permalink
scsi: scsi_dh_alua: Warn if the first argument of alua_rtpg_queue() i…
Browse files Browse the repository at this point in the history
…s 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>
  • Loading branch information
Bart Van Assche authored and Martin K. Petersen committed Mar 19, 2017
1 parent 7cb689f commit 0aeccdf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/device_handler/scsi_dh_alua.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0aeccdf

Please sign in to comment.