mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
NFC: pn533: Fix bad allocation size
Use dereferenced pointer in sizeof instead of pointer itself. Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
fb97c3e80f
commit
858ce02209
@ -743,7 +743,7 @@ static int __pn533_send_async(struct pn533 *dev, u8 cmd_code,
|
||||
|
||||
nfc_dev_dbg(&dev->interface->dev, "Sending command 0x%x", cmd_code);
|
||||
|
||||
arg = kzalloc(sizeof(arg), GFP_KERNEL);
|
||||
arg = kzalloc(sizeof(*arg), GFP_KERNEL);
|
||||
if (!arg)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -863,7 +863,7 @@ static int pn533_send_cmd_direct_async(struct pn533 *dev, u8 cmd_code,
|
||||
if (!resp)
|
||||
return -ENOMEM;
|
||||
|
||||
arg = kzalloc(sizeof(arg), GFP_KERNEL);
|
||||
arg = kzalloc(sizeof(*arg), GFP_KERNEL);
|
||||
if (!arg) {
|
||||
dev_kfree_skb(resp);
|
||||
return -ENOMEM;
|
||||
|
Loading…
Reference in New Issue
Block a user