Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea9917d6 authored by Ilan Elias's avatar Ilan Elias Committed by John W. Linville
Browse files

NFC: Free sk_buff if nfcwilink_send fails



Free sk_buff if nfcwilink_send fails.

Signed-off-by: default avatarIlan Elias <ilane@ti.com>
Acked-by: default avatarSamuel Ortiz <sameo@linux.intel.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 1195d89b
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -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);