From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by dpdk.org (Postfix) with ESMTP id 4FDF79A8F for ; Wed, 25 Feb 2015 09:46:20 +0100 (CET) Received: by wesw55 with SMTP id w55so2109879wes.5 for ; Wed, 25 Feb 2015 00:46:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=2bT9yQh2iz26qdB0XCl/yTQcNDgyQedZ2a1AiKTz9HU=; b=BqYGo97ywfjWlNzOKKATA8DaSIC/O4O8Pve4MoZ4lx42v7gre4LwRbJfjFBGpsQWN6 +SvMLNhA4uONndSvSOjSPk8cjA7DawNnIz35x+HfdORNnlLTyo0q6HVI7t7SuiK1STYX LyhuenjpaG+/Os2ruzl3AKe47z9Ie3xh6YtYnebBiHJLPFg/dAT4XyT8FoiXbFTSAN8c MOeNheaH8m5BFwUERem+DkbSt2EwnxWG4PVyuW5VDbEqx9VCy0tzQ7F3B2m9Y9nueoEe koHgrv8ZcY7m8on99KEXuApjIKWJwKiiWfmnp3+dR+u8nZNYJp1URGj4oVI0fmt/ymlt iH/Q== X-Gm-Message-State: ALoCoQkWD8/uGVX8LQu1N2eGFWuUIuP+hc/COacUJjBEGenBNCnKl/tyS8A0FFgiuo6GJECW0d4K X-Received: by 10.194.240.97 with SMTP id vz1mr3909386wjc.155.1424853980134; Wed, 25 Feb 2015 00:46:20 -0800 (PST) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id r3sm59501050wjw.7.2015.02.25.00.46.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 25 Feb 2015 00:46:19 -0800 (PST) From: Thomas Monjalon To: "Liang, Cunming" Date: Wed, 25 Feb 2015 09:45:46 +0100 Message-ID: <1514821.oaVEE2NRMm@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: References: <1423732089-6202-1-git-send-email-cunming.liang@intel.com> <20150220183854.GA4179@tuxdriver.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org, John Linville Subject: Re: [dpdk-dev] [PATCH v1] afpacket: fix critical issue reported by klocwork X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Feb 2015 08:46:20 -0000 2015-02-25 00:57, Liang, Cunming: > From: John W. Linville [mailto:linville@tuxdriver.com] > > On Fri, Feb 20, 2015 at 11:19:59AM +0100, Thomas Monjalon wrote: > > > 2015-02-12 17:08, Cunming Liang: > > > > --- a/lib/librte_pmd_af_packet/rte_eth_af_packet.c > > > > +++ b/lib/librte_pmd_af_packet/rte_eth_af_packet.c > > > > @@ -439,13 +439,15 @@ rte_pmd_init_internals(const char *name, > > > > size_t ifnamelen; > > > > unsigned k_idx; > > > > struct sockaddr_ll sockaddr; > > > > - struct tpacket_req *req; > > > > + struct tpacket_req *req = NULL; > > > > > > If *internals is set to NULL, there should be no case where req used > > > and undefined. > > [LCM] Agree, so that's why I add '*internals = NULL' below as well. > > > > I agree -- it looks to me like req is protected by checking for > > *internals == NULL. I don't think this patch is necessary. > > [LCM] The major piece of the patch is add setting for '*internals=NULL;'. Yes understood, but it is already initialized to NULL before calling rte_pmd_init_internals(): http://dpdk.org/browse/dpdk/tree/lib/librte_pmd_af_packet/rte_eth_af_packet.c#n706