Skip to content

Commit

Permalink
nfc: netlink: Warning fix
Browse files Browse the repository at this point in the history
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);

Cc: [email protected]
Signed-off-by: Christophe Ricard <[email protected]>
Signed-off-by: Samuel Ortiz <[email protected]>
  • Loading branch information
cricard13 authored and Samuel Ortiz committed Aug 17, 2015
1 parent fe202fe commit adca3c3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/nfc/netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit adca3c3

Please sign in to comment.