mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
nfc: netlink: Add check on NFC_ATTR_VENDOR_DATA
NFC_ATTR_VENDOR_DATA is an optional vendor_cmd argument. The current code was potentially using a non existing argument leading to potential catastrophic results. Cc: [email protected] Signed-off-by: Christophe Ricard <[email protected]> Signed-off-by: Samuel Ortiz <[email protected]>
This commit is contained in:
parent
94b85938ad
commit
fe202fe955
1 changed files with 2 additions and 2 deletions
|
|
@ -1518,8 +1518,8 @@ static int nfc_genl_vendor_cmd(struct sk_buff *skb,
|
|||
if (!dev || !dev->vendor_cmds || !dev->n_vendor_cmds)
|
||||
return -ENODEV;
|
||||
|
||||
data = nla_data(info->attrs[NFC_ATTR_VENDOR_DATA]);
|
||||
if (data) {
|
||||
if (info->attrs[NFC_ATTR_VENDOR_DATA]) {
|
||||
data = nla_data(info->attrs[NFC_ATTR_VENDOR_DATA]);
|
||||
data_len = nla_len(info->attrs[NFC_ATTR_VENDOR_DATA]);
|
||||
if (data_len == 0)
|
||||
return -EINVAL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue