Skip to content

Commit

Permalink
NFC: pn533: Fix bad allocation size
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thierry Escande authored and Samuel Ortiz committed Jan 13, 2013
1 parent fb97c3e commit 858ce02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/nfc/pn533.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 858ce02

Please sign in to comment.