From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755991AbbIZU6b (ORCPT ); Sat, 26 Sep 2015 16:58:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:55284 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754138AbbIZU5L (ORCPT ); Sat, 26 Sep 2015 16:57:11 -0400 From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Ricard , Samuel Ortiz Subject: [PATCH 4.2 009/134] nfc: netlink: Warning fix Date: Sat, 26 Sep 2015 13:54:21 -0700 Message-Id: <20150926205312.398504770@linuxfoundation.org> X-Mailer: git-send-email 2.5.3 In-Reply-To: <20150926205311.819185658@linuxfoundation.org> References: <20150926205311.819185658@linuxfoundation.org> User-Agent: quilt/0.64 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.2-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Ricard commit adca3c38d807b341a965d0aba8721d0784d8471b upstream. When NFC_ATTR_VENDOR_DATA is not set, data_len is 0 and data is NULL. Fixes the following warning: net/nfc/netlink.c:1536:3: warning: 'data' may be used uninitialized +in this function [-Wmaybe-uninitialized] return cmd->doit(dev, data, data_len); Signed-off-by: Christophe Ricard Signed-off-by: Samuel Ortiz Signed-off-by: Greg Kroah-Hartman --- net/nfc/netlink.c | 1 + 1 file changed, 1 insertion(+) --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c @@ -1524,6 +1524,7 @@ static int nfc_genl_vendor_cmd(struct sk if (data_len == 0) return -EINVAL; } else { + data = NULL; data_len = 0; }