From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Weiguo Li <liwg06@foxmail.com>, vsrivast@xilinx.com
Cc: dev@dpdk.org
Subject: Re: [PATCH] vdpa/sfc: fix null pointer dereference
Date: Thu, 10 Feb 2022 16:12:41 +0100 [thread overview]
Message-ID: <906ae5ff-106e-4a91-af6c-47431b956561@redhat.com> (raw)
In-Reply-To: <tencent_A1C68827F89429E24C47E05B63A440E42E05@qq.com>
On 1/29/22 18:30, Weiguo Li wrote:
> When sva is null, sfc_vdpa_info(sva, ...) will cause a null
> dereference. Use SFC_VDPA_GENERIC_LOG() to avoid that.
> See macros sfc_vdpa_info and SFC_VDPA_GENERIC_LOG
> defined in drivers/vdpa/sfc/sfc_vdpa_log.h for detail.
>
> Fixes: 5e7596ba7cb3 ("vdpa/sfc: introduce Xilinx vDPA driver")
>
> Signed-off-by: Weiguo Li <liwg06@foxmail.com>
> ---
> drivers/vdpa/sfc/sfc_vdpa.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/sfc/sfc_vdpa.c b/drivers/vdpa/sfc/sfc_vdpa.c
> index fccdd8c687..53f598facc 100644
> --- a/drivers/vdpa/sfc/sfc_vdpa.c
> +++ b/drivers/vdpa/sfc/sfc_vdpa.c
> @@ -328,7 +328,8 @@ sfc_vdpa_pci_remove(struct rte_pci_device *pci_dev)
>
> sva = sfc_vdpa_get_adapter_by_dev(pci_dev);
> if (sva == NULL) {
> - sfc_vdpa_info(sva, "invalid device: %s", pci_dev->name);
> + SFC_VDPA_GENERIC_LOG(INFO,
> + "Invalid device: %s.", pci_dev->name);
> return -1;
> }
>
Applied to dpdk-next-virtio/main.
Thanks,
Maxime
prev parent reply other threads:[~2022-02-10 15:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-29 17:30 Weiguo Li
2022-02-04 11:56 ` Weiguo Li
2022-02-10 14:37 ` [PATCH] " Maxime Coquelin
2022-02-10 15:11 ` Maxime Coquelin
2022-02-10 15:12 ` Maxime Coquelin [this message]
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=906ae5ff-106e-4a91-af6c-47431b956561@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=dev@dpdk.org \
--cc=liwg06@foxmail.com \
--cc=vsrivast@xilinx.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;
as well as URLs for NNTP newsgroup(s).