[dpdk-dev] [PATCH 1/6] i40e: fix problematic dereference
Stephen Hemminger
stephen at networkplumber.org
Thu Apr 21 18:10:19 CEST 2016
On Thu, 21 Apr 2016 11:42:52 +0800
Helin Zhang <helin.zhang at intel.com> wrote:
> Fix issue reported by Coverity.
>
> Coverity ID 119267: Dereference before null check.
>
> Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage")
>
> Signed-off-by: Helin Zhang <helin.zhang at intel.com>
> ---
> drivers/net/i40e/i40e_rxtx.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
> index 4d35d83..9c126a3 100644
> --- a/drivers/net/i40e/i40e_rxtx.c
> +++ b/drivers/net/i40e/i40e_rxtx.c
> @@ -2592,14 +2592,14 @@ i40e_rx_queue_release_mbufs(struct i40e_rx_queue *rxq)
> {
> uint16_t i;
>
> - /* SSE Vector driver has a different way of releasing mbufs. */
> - if (rxq->rx_using_sse) {
> - i40e_rx_queue_release_mbufs_vec(rxq);
> + if (!rxq || !rxq->sw_ring) {
> + PMD_DRV_LOG(DEBUG, "Pointer to rxq or sw_ring is NULL");
> return;
> }
>
I can't see how you could ever trigger this.
i40e_rx_queue_release_mbufs() is called only called from places where rxq
is guraanteed non NULL.
Are you sure Coverity isn't tell you that?
More information about the dev
mailing list