From: Simon Horman <simon.horman@corigine.com>
To: Gautam Dawar <gautam.dawar@amd.com>
Cc: linux-net-drivers@amd.com, jasowang@redhat.com,
Edward Cree <ecree.xilinx@gmail.com>,
Martin Habets <habetsm.xilinx@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Richard Cochran <richardcochran@gmail.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
eperezma@redhat.com, harpreet.anand@amd.com, tanuj.kamde@amd.com,
koushik.dutta@amd.com
Subject: Re: [PATCH net-next v4 02/14] sfc: implement MCDI interface for vDPA operations
Date: Mon, 10 Apr 2023 11:54:27 +0200 [thread overview]
Message-ID: <ZDPc063jzve18fqp@corigine.com> (raw)
In-Reply-To: <20230407081021.30952-3-gautam.dawar@amd.com>
On Fri, Apr 07, 2023 at 01:40:03PM +0530, Gautam Dawar wrote:
> Implement functions to perform vDPA operations like creating and
> removing virtqueues, getting doorbell register offset etc. using
> the MCDI interface with FW.
>
> Signed-off-by: Gautam Dawar <gautam.dawar@amd.com>
Hi Gautam,
thanks for your patch.
I think that I found a minor problem, as described below.
...
> diff --git a/drivers/net/ethernet/sfc/mcdi_vdpa.c b/drivers/net/ethernet/sfc/mcdi_vdpa.c
...
> +void efx_vdpa_vring_fini(struct efx_vring_ctx *vring_ctx)
> +{
> + kfree(vring_ctx);
> +}
> +
> +int efx_vdpa_get_features(struct efx_nic *efx,
> + enum ef100_vdpa_device_type type,
> + u64 *features)
> +{
> + MCDI_DECLARE_BUF(outbuf, MC_CMD_VIRTIO_GET_FEATURES_OUT_LEN);
> + MCDI_DECLARE_BUF(inbuf, MC_CMD_VIRTIO_GET_FEATURES_IN_LEN);
> + u32 high_val, low_val;
> + ssize_t outlen;
> + int rc;
> +
> + if (!efx) {
> + pci_err(efx->pci_dev, "%s: Invalid NIC pointer\n", __func__);
efx is NULL but it is dereferenced.
Reported by Smatch as:
drivers/net/ethernet/sfc/mcdi_vdpa.c:72 efx_vdpa_get_features() error: we previously assumed 'efx' could be null (see line 71)
And by Coccinelle as:
drivers/net/ethernet/sfc/mcdi_vdpa.c:72:15-22: ERROR: efx is NULL but dereferenced.
> + return -EINVAL;
> + }
...
next prev parent reply other threads:[~2023-04-10 9:55 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-07 8:10 [PATCH net-next v4 00/14] sfc: add vDPA support for EF100 devices Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 01/14] sfc: add function personality " Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 02/14] sfc: implement MCDI interface for vDPA operations Gautam Dawar
2023-04-10 9:54 ` Simon Horman [this message]
2023-04-07 8:10 ` [PATCH net-next v4 03/14] sfc: update MCDI headers for CLIENT_CMD_VF_PROXY capability bit Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 04/14] sfc: evaluate vdpa support based on FW capability CLIENT_CMD_VF_PROXY Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 05/14] sfc: implement init and fini functions for vDPA personality Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 06/14] sfc: implement vDPA management device operations Gautam Dawar
2023-04-10 10:22 ` Simon Horman
2023-04-07 8:10 ` [PATCH net-next v4 07/14] sfc: implement vdpa device config operations Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 08/14] sfc: implement vdpa vring " Gautam Dawar
2023-04-10 12:48 ` Simon Horman
2023-04-07 8:10 ` [PATCH net-next v4 09/14] sfc: implement device status related vdpa " Gautam Dawar
2023-04-08 3:20 ` Jakub Kicinski
2023-04-10 6:23 ` Gautam Dawar
2023-04-10 12:47 ` Simon Horman
2023-04-07 8:10 ` [PATCH net-next v4 10/14] sfc: implement filters for receiving traffic Gautam Dawar
2023-04-08 3:21 ` Jakub Kicinski
2023-04-10 6:25 ` Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 11/14] sfc: use PF's IOMMU domain for running VF's MCDI commands Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 12/14] sfc: unmap VF's MCDI buffer when switching to vDPA mode Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 13/14] sfc: update vdpa device MAC address Gautam Dawar
2023-04-07 8:10 ` [PATCH net-next v4 14/14] sfc: register the vDPA device Gautam Dawar
2023-04-09 9:13 ` [PATCH net-next v4 00/14] sfc: add vDPA support for EF100 devices Leon Romanovsky
2023-04-10 1:39 ` Jason Wang
2023-04-10 6:33 ` Gautam Dawar
2023-04-10 7:53 ` Leon Romanovsky
2023-04-24 15:46 ` Martin Habets
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=ZDPc063jzve18fqp@corigine.com \
--to=simon.horman@corigine.com \
--cc=davem@davemloft.net \
--cc=ecree.xilinx@gmail.com \
--cc=edumazet@google.com \
--cc=eperezma@redhat.com \
--cc=gautam.dawar@amd.com \
--cc=habetsm.xilinx@gmail.com \
--cc=harpreet.anand@amd.com \
--cc=jasowang@redhat.com \
--cc=koushik.dutta@amd.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@amd.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=tanuj.kamde@amd.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).