All of lore.kernel.org
 help / color / mirror / Atom feed
From: Manish Rangankar <mrangankar@marvell.com>
To: Kangjie Lu <kjlu@umn.edu>
Cc: "pakki001@umn.edu" <pakki001@umn.edu>,
	"QLogic-Storage-Upstream@qlogic.com" 
	<QLogic-Storage-Upstream@qlogic.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] scsi: qla4xxx: fix a potential NULL pointer dereference
Date: Mon, 25 Mar 2019 06:18:30 +0000	[thread overview]
Message-ID: <BYAPR18MB24857ABD5DDE4D62E35F9C6DD85E0@BYAPR18MB2485.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20190314063100.12805-1-kjlu@umn.edu>

> -----Original Message-----
> From: linux-scsi-owner@vger.kernel.org <linux-scsi-
> owner@vger.kernel.org> On Behalf Of Kangjie Lu
> Sent: Thursday, March 14, 2019 12:01 PM
> To: kjlu@umn.edu
> Cc: pakki001@umn.edu; QLogic-Storage-Upstream@qlogic.com; James E.J.
> Bottomley <jejb@linux.ibm.com>; Martin K. Petersen
> <martin.petersen@oracle.com>; linux-scsi@vger.kernel.org; linux-
> kernel@vger.kernel.org
> Subject: [PATCH] scsi: qla4xxx: fix a potential NULL pointer dereference
> 
> In case iscsi_lookup_endpoint fails, the fix returns -EINVAL to avoid NULL
> pointer dereference.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>
> ---
>  drivers/scsi/qla4xxx/ql4_os.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
> index a77bfb224248..80289c885c07 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -3203,6 +3203,8 @@ static int qla4xxx_conn_bind(struct
> iscsi_cls_session *cls_session,
>  	if (iscsi_conn_bind(cls_session, cls_conn, is_leading))
>  		return -EINVAL;
>  	ep = iscsi_lookup_endpoint(transport_fd);
> +	if (!ep)
> +		return -EINVAL;
>  	conn = cls_conn->dd_data;
>  	qla_conn = conn->dd_data;
>  	qla_conn->qla_ep = ep->dd_data;
> --
> 2.17.1

Thanks
Acked-by: Manish Rangankar <mrangankar@marvell.com>


  parent reply	other threads:[~2019-03-25  6:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14  6:30 [PATCH] scsi: qla4xxx: fix a potential NULL pointer dereference Kangjie Lu
2019-03-23 22:39 ` Aditya Pakki
2019-03-23 22:39   ` Aditya Pakki
2019-03-25  6:18 ` Manish Rangankar [this message]
2019-03-25  6:18   ` Manish Rangankar
2019-03-26  2:25 ` 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=BYAPR18MB24857ABD5DDE4D62E35F9C6DD85E0@BYAPR18MB2485.namprd18.prod.outlook.com \
    --to=mrangankar@marvell.com \
    --cc=QLogic-Storage-Upstream@qlogic.com \
    --cc=jejb@linux.ibm.com \
    --cc=kjlu@umn.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=pakki001@umn.edu \
    /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.