[PATCH] nfc: netlink: Fix "warning: 'data' may be used uninitialized in this function"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When NFC_ATTR_VENDOR_DATA is not set, data_len is 0 and data is NULL.

Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Christophe Ricard <christophe-h.ricard@xxxxxx>
---
 net/nfc/netlink.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index 81dfaaa..73d1ca7 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -1524,6 +1524,7 @@ static int nfc_genl_vendor_cmd(struct sk_buff *skb,
 		if (data_len == 0)
 			return -EINVAL;
 	} else {
+		data = NULL;
 		data_len = 0;
 	}
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]