All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: "Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>,
	Bart Van Assche <bart.vanassche@sandisk.com>,
	Tang Junhui <tang.junhui@zte.com.cn>
Subject: [PATCH 3/3] scsi_dh_alua: Warn if the first argument of alua_rtpg_queue() is NULL
Date: Fri, 17 Mar 2017 17:02:03 -0700	[thread overview]
Message-ID: <20170318000203.7469-4-bart.vanassche@sandisk.com> (raw)
In-Reply-To: <20170318000203.7469-1-bart.vanassche@sandisk.com>

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>
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.12.0

  parent reply	other threads:[~2017-03-18  0:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-18  0:02 [PATCH 0/3] SCSI ALUA device handler bug fixes Bart Van Assche
2017-03-18  0:02 ` [PATCH 1/3] scsi_dh_alua: Check scsi_device_get() return value Bart Van Assche
2017-03-18  0:02   ` Bart Van Assche
2017-03-18 11:17   ` Hannes Reinecke
2017-03-18 11:17     ` Hannes Reinecke
2017-03-18  0:02 ` [PATCH 2/3] scsi_dh_alua: Ensure that alua_activate() calls the completion function Bart Van Assche
2017-03-18  0:02   ` Bart Van Assche
2017-03-18 11:19   ` Hannes Reinecke
2017-03-18 11:19     ` Hannes Reinecke
2017-03-18  0:02 ` Bart Van Assche [this message]
2017-03-18 11:19   ` [PATCH 3/3] scsi_dh_alua: Warn if the first argument of alua_rtpg_queue() is NULL Hannes Reinecke
2017-03-19 17:17 ` [PATCH 0/3] SCSI ALUA device handler bug fixes Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170318000203.7469-4-bart.vanassche@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=tang.junhui@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.