From: Ilan Elias Date: Tue, 17 Jan 2012 12:11:33 +0000 (+0200) Subject: NFC: Free sk_buff if nfcwilink_send fails X-Git-Tag: firefly_0821_release~3680^2~3338^2~112^2~401 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=ea9917d6f9e355646258b8d08ac69108908618a2;p=firefly-linux-kernel-4.4.55.git NFC: Free sk_buff if nfcwilink_send fails Free sk_buff if nfcwilink_send fails. Signed-off-by: Ilan Elias Acked-by: Samuel Ortiz Signed-off-by: John W. Linville --- diff --git a/drivers/nfc/nfcwilink.c b/drivers/nfc/nfcwilink.c index 90af28d611f6..1f74a77d040d 100644 --- a/drivers/nfc/nfcwilink.c +++ b/drivers/nfc/nfcwilink.c @@ -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);