From: Simon Horman <horms@kernel.org>
To: Wenchao Hao <haowenchao2@huawei.com>
Cc: Hannes Reinecke <hare@suse.de>,
"James E . J . Bottomley" <jejb@linux.ibm.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Richard Cochran <richardcochran@gmail.com>,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
netdev@vger.kernel.org, louhongxiang@huawei.com
Subject: Re: [PATCH] scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup
Date: Fri, 13 Oct 2023 17:41:41 +0200 [thread overview]
Message-ID: <20231013154141.GO29570@kernel.org> (raw)
In-Reply-To: <20231011130350.819571-1-haowenchao2@huawei.com>
On Wed, Oct 11, 2023 at 09:03:50PM +0800, Wenchao Hao wrote:
> fc_lport_ptp_setup() did not check the return value of fc_rport_create()
> which is possible to return NULL which would cause a NULL pointer
> dereference. Address this issue by checking return value of
> fc_rport_create() and log error message on fc_rport_create() failed.
>
> Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
Thanks,
I verified that fc_lport_ptp_setup can return NULL (if kzalloc fails).
Reviewed-by: Simon Horman <horms@kernel.org>
next prev parent reply other threads:[~2023-10-13 15:41 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-11 13:03 [PATCH] scsi: libfc: Fix potential NULL pointer dereference in fc_lport_ptp_setup Wenchao Hao
2023-10-13 15:41 ` Simon Horman [this message]
2023-10-13 18:06 ` Martin K. Petersen
2023-10-17 1:11 ` 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=20231013154141.GO29570@kernel.org \
--to=horms@kernel.org \
--cc=haowenchao2@huawei.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=louhongxiang@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=netdev@vger.kernel.org \
--cc=richardcochran@gmail.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.