[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZDPc063jzve18fqp@corigine.com>
Date: Mon, 10 Apr 2023 11:54:27 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Gautam Dawar <gautam.dawar@....com>
Cc: linux-net-drivers@....com, jasowang@...hat.com,
Edward Cree <ecree.xilinx@...il.com>,
Martin Habets <habetsm.xilinx@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Richard Cochran <richardcochran@...il.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
eperezma@...hat.com, harpreet.anand@....com, tanuj.kamde@....com,
koushik.dutta@....com
Subject: Re: [PATCH net-next v4 02/14] sfc: implement MCDI interface for vDPA
operations
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@....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;
> + }
...
Powered by blists - more mailing lists