From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH] net/virtio: fix null pointer dereference Date: Tue, 5 Jul 2016 20:14:35 +0800 Message-ID: <20160705121435.GK26521@yliu-dev.sh.intel.com> References: <1467718979-20904-1-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, huawei.xie@intel.com, michalx.k.jastrzebski@intel.com To: Jianfeng Tan Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 9A59258D4 for ; Tue, 5 Jul 2016 14:13:11 +0200 (CEST) Content-Disposition: inline In-Reply-To: <1467718979-20904-1-git-send-email-jianfeng.tan@intel.com> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jul 05, 2016 at 11:42:59AM +0000, Jianfeng Tan wrote: > There is a logic bug in this code, that could lead to null pointer > dereference when cvq is NULL. Fix this problem by changing logic > _and_ to logic _or_. > > >> CID 127480: Null pointer dereferences (FORWARD_NULL) > >> Dereferencing null pointer "cvq". > if (!cvq && !cvq->vq) { > ... > } > > Coverity issue: 127480 > > Fixes: 01ad44fd374f ("net/virtio: split Rx/Tx queue") > > Signed-off-by: Jianfeng Tan Applied to dpdk-next-virtio. Thanks. --yliu