From: "Jürgen Groß" <jgross@suse.com>
To: yskelg@gmail.com, Stefano Stabellini <sstabellini@kernel.org>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>
Cc: skhan@linuxfoundation.org, sj@kernel.org,
Austin Kim <austindh.kim@gmail.com>,
shjy180909@gmail.com, linux-kernel@vger.kernel.org,
xen-devel@lists.xenproject.org,
linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH] xen/xenbus: handle potential dangling pointer issue in xen_pcibk_xenbus_probe
Date: Wed, 29 May 2024 14:27:54 +0200 [thread overview]
Message-ID: <0c53415d-3394-455a-a6b5-99d3efb92318@suse.com> (raw)
In-Reply-To: <20240529122232.25360-1-yskelg@gmail.com>
On 29.05.24 14:22, yskelg@gmail.com wrote:
> From: Yunseong Kim <yskelg@gmail.com>
>
> If 'xen_pcibk_init_devices()' fails. This ensures that 'pdev->xdev' does
> not point to 'xdev' when 'pdev' is freed.
>
> Signed-off-by: Yunseong Kim <yskelg@gmail.com>
> ---
> drivers/xen/xen-pciback/xenbus.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/xen/xen-pciback/xenbus.c b/drivers/xen/xen-pciback/xenbus.c
> index b11e401f1b1e..348d6803b8c0 100644
> --- a/drivers/xen/xen-pciback/xenbus.c
> +++ b/drivers/xen/xen-pciback/xenbus.c
> @@ -54,6 +54,7 @@ static struct xen_pcibk_device *alloc_pdev(struct xenbus_device *xdev)
> INIT_WORK(&pdev->op_work, xen_pcibk_do_op);
>
> if (xen_pcibk_init_devices(pdev)) {
> + pdev->xdev = NULL;
> kfree(pdev);
> pdev = NULL;
> }
NAK.
This doesn't make any sense, as pdev is freed.
Juergen
next prev parent reply other threads:[~2024-05-29 12:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-29 12:22 [PATCH] xen/xenbus: handle potential dangling pointer issue in xen_pcibk_xenbus_probe yskelg
2024-05-29 12:27 ` Jürgen Groß [this message]
2024-05-29 13:36 ` Yunseong Kim
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=0c53415d-3394-455a-a6b5-99d3efb92318@suse.com \
--to=jgross@suse.com \
--cc=austindh.kim@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleksandr_tyshchenko@epam.com \
--cc=shjy180909@gmail.com \
--cc=sj@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=yskelg@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox