Skip to content

Commit

Permalink
NFC: Free sk_buff if nfcwilink_send fails
Browse files Browse the repository at this point in the history
Free sk_buff if nfcwilink_send fails.

Signed-off-by: Ilan Elias <ilane@ti.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Ilan Elias authored and John W. Linville committed Jan 24, 2012
1 parent 1195d89 commit ea9917d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/nfc/nfcwilink.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,8 +489,10 @@ static int nfcwilink_send(struct sk_buff *skb)

nfc_dev_dbg(&drv->pdev->dev, "send entry, len %d", skb->len);

if (!test_bit(NFCWILINK_RUNNING, &drv->flags))
return -EBUSY;
if (!test_bit(NFCWILINK_RUNNING, &drv->flags)) {
kfree_skb(skb);
return -EINVAL;
}

/* add the ST hdr to the start of the buffer */
hdr.len = cpu_to_le16(skb->len);
Expand Down

0 comments on commit ea9917d

Please sign in to comment.