From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 857544D27; Fri, 16 Nov 2018 17:59:08 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 1C17621BFD; Fri, 16 Nov 2018 11:59:08 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Fri, 16 Nov 2018 11:59:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=mesmtp; bh=vahhRK12dL TbLhe7wohN9l57CmCJG29LBezrXHb5M0Q=; b=II+1I6XweyhtYspVFrpaPwtVq2 kHRtf2eLlbAaIEOroI7zGu0IAApAcEOaRml+X0Hux8v+/vke/m8lI1ejmfhQqyED tiPWmSmC7qfsOw7cxdzEkOEcVvQFowpimLNJzVjicTYhXoruqJTCIURry0efPxPq CcGG54N4Bv2sMF77Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=vahhRK12dLTbLhe7wohN9l57CmCJG29LBezrXHb5M0Q=; b=byvhaTW9 7eMhj1jWZARzhSQt/iWjtgm8cZXzR2bmY3l+LIYNR5KrDfqXNCPNlZGHuxZjT5H0 bJFu1lVSL66yh3yxlbzGHBTzZECgRz/dLppgI5psRQCpgSbRg4ghGTEfie3a3nXR yzWaZf61/uJYqAmU35LqA0mXuzVHsrE2ASA06O3FHBUeK6lK4TxwDp1Q0mo6wN9n ZdfqBPCdb28iy7uMPl1jtU87TAdgC/hA68yA5mAo//gC4COj91+8Twd+t04l1Ytb GbU0FBVUWnfys5ZZYgko02OlIb+mHolfeywSBGCtYRjsFs+GCPYK2T5D8fIDLEao QCr64i/KlOhJYw== X-ME-Sender: X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 5EBF2102E8; Fri, 16 Nov 2018 11:59:07 -0500 (EST) From: Thomas Monjalon To: dev@dpdk.org Cc: stable@dpdk.org Date: Fri, 16 Nov 2018 17:58:51 +0100 Message-Id: <20181116165854.24017-3-thomas@monjalon.net> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181116165854.24017-1-thomas@monjalon.net> References: <20181116165854.24017-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 2/5] kni: fix possible uninitialized variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2018 16:59:09 -0000 This error can be raised: lib/librte_kni/rte_kni.c:531:15: error: 'req' may be used uninitialized in this function It should not happen because kni_fifo_get() would return 0 if req is not initialized, so the function would return before using req. But GCC complains about it in -O1 optimization, and a NULL initialization is harmless here. Fixes: 3fc5ca2f6352 ("kni: initial import") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- lib/librte_kni/rte_kni.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c index c9726d4f8..73aeccccf 100644 --- a/lib/librte_kni/rte_kni.c +++ b/lib/librte_kni/rte_kni.c @@ -483,7 +483,7 @@ int rte_kni_handle_request(struct rte_kni *kni) { unsigned ret; - struct rte_kni_request *req; + struct rte_kni_request *req = NULL; if (kni == NULL) return -1; -- 2.19.0