Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Saurav Kashyap <skashyap@marvell.com>
To: Jiasheng Jiang <jiasheng@iscas.ac.cn>,
	Javed Hasan <jhasan@marvell.com>,
	GR-QLogic-Storage-Upstream
	<GR-QLogic-Storage-Upstream@marvell.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"linux@armlinux.org.uk" <linux@armlinux.org.uk>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: RE: [EXT] [PATCH] scsi: qedf: potential dereference of null pointer
Date: Tue, 4 Jan 2022 04:05:15 +0000	[thread overview]
Message-ID: <DM6PR18MB3034EC46365E384336A44E53D24A9@DM6PR18MB3034.namprd18.prod.outlook.com> (raw)
In-Reply-To: <20211216101449.375953-1-jiasheng@iscas.ac.cn>

HI Jiasheng Jiang,

> -----Original Message-----
> From: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> Sent: Thursday, December 16, 2021 3:45 PM
> To: Saurav Kashyap <skashyap@marvell.com>; Javed Hasan
> <jhasan@marvell.com>; GR-QLogic-Storage-Upstream <GR-QLogic-Storage-
> Upstream@marvell.com>; jejb@linux.ibm.com; martin.petersen@oracle.com;
> linux@armlinux.org.uk
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org;
> netdev@vger.kernel.org; Jiasheng Jiang <jiasheng@iscas.ac.cn>
> Subject: [EXT] [PATCH] scsi: qedf: potential dereference of null pointer
> 
> External Email
> 
> ----------------------------------------------------------------------
> The return value of dma_alloc_coherent() needs to be checked.
> To avoid use of null pointer in case of the failure of alloc.
> 
> Fixes: 61d8658b4a43 ("scsi: qedf: Add QLogic FastLinQ offload FCoE driver
> framework.")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  drivers/scsi/qedf/qedf_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/qedf/qedf_main.c b/drivers/scsi/qedf/qedf_main.c
> index b92570a7c309..309e205a8e70 100644
> --- a/drivers/scsi/qedf/qedf_main.c
> +++ b/drivers/scsi/qedf/qedf_main.c
> @@ -1415,6 +1415,8 @@ static void qedf_upload_connection(struct qedf_ctx
> *qedf,
>  	 */
>  	term_params = dma_alloc_coherent(&qedf->pdev->dev,
> QEDF_TERM_BUFF_SIZE,
>  		&term_params_dma, GFP_KERNEL);
> +	if (!term_params)
> +		return;
> 
>  	QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_CONN, "Uploading
> connection "
>  		   "port_id=%06x.\n", fcport->rdata->ids.port_id);
> --

Acked-by: Saurav Kashyap <skashyap@marvell.com>

Thanks,
~Saurav
> 2.25.1


  parent reply	other threads:[~2022-01-04  4:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-16 10:14 Jiasheng Jiang
2022-01-03  4:58 ` [EXT] " Saurav Kashyap
2022-01-03 17:12   ` Jakub Kicinski
2022-01-04  4:05 ` Saurav Kashyap [this message]
2022-01-05  5:20 ` Martin K. Petersen
2022-01-10 22:04 ` 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=DM6PR18MB3034EC46365E384336A44E53D24A9@DM6PR18MB3034.namprd18.prod.outlook.com \
    --to=skashyap@marvell.com \
    --cc=GR-QLogic-Storage-Upstream@marvell.com \
    --cc=jejb@linux.ibm.com \
    --cc=jhasan@marvell.com \
    --cc=jiasheng@iscas.ac.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=martin.petersen@oracle.com \
    --cc=netdev@vger.kernel.org \
    --subject='RE: [EXT] [PATCH] scsi: qedf: potential dereference of null pointer' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).