From: Chris Leech <cleech@redhat.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Mike Christie <michaelc@cs.wisc.edu>,
Nilesh Javali <njavali@marvell.com>,
Manish Rangankar <mrangankar@marvell.com>,
GR-QLogic-Storage-Upstream@marvell.com,
"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
James Bottomley <JBottomley@parallels.com>,
Ravi Anand <ravi.anand@qlogic.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] scsi: qla4xxx: Prevent a potential error pointer dereference
Date: Wed, 13 Aug 2025 14:03:57 -0700 [thread overview]
Message-ID: <aJz9vY0sGj2a98kE@my-developer-toolbox-latest> (raw)
In-Reply-To: <aJwnVKS9tHsw1tEu@stanley.mountain>
On Wed, Aug 13, 2025 at 08:49:08AM +0300, Dan Carpenter wrote:
> The qla4xxx_get_ep_fwdb() function is supposed to return NULL on error,
> but qla4xxx_ep_connect() returns error pointers. Propagating the error
> pointers will lead to an Oops in the caller, so change the error
> pointers to NULL.
Looks right to me.
Reviewed-by: Chris Leech <cleech@redhat.com>
> Fixes: 13483730a13b ("[SCSI] qla4xxx: fix flash/ddb support")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> 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 a39f1da4ce47..a761c0aa5127 100644
> --- a/drivers/scsi/qla4xxx/ql4_os.c
> +++ b/drivers/scsi/qla4xxx/ql4_os.c
> @@ -6606,6 +6606,8 @@ static struct iscsi_endpoint *qla4xxx_get_ep_fwdb(struct scsi_qla_host *ha,
>
> ep = qla4xxx_ep_connect(ha->host, (struct sockaddr *)dst_addr, 0);
> vfree(dst_addr);
> + if (IS_ERR(ep))
> + return NULL;
> return ep;
> }
>
> --
> 2.47.2
>
next prev parent reply other threads:[~2025-08-13 21:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 5:49 [PATCH] scsi: qla4xxx: Prevent a potential error pointer dereference Dan Carpenter
2025-08-13 21:03 ` Chris Leech [this message]
2025-08-15 3:38 ` 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=aJz9vY0sGj2a98kE@my-developer-toolbox-latest \
--to=cleech@redhat.com \
--cc=GR-QLogic-Storage-Upstream@marvell.com \
--cc=JBottomley@parallels.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=dan.carpenter@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michaelc@cs.wisc.edu \
--cc=mrangankar@marvell.com \
--cc=njavali@marvell.com \
--cc=ravi.anand@qlogic.com \
/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.