summaryrefslogtreecommitdiff
path: root/drivers/nfc/nfcmrvl
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-03-08 08:22:37 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2017-04-02 01:09:17 +0300
commitca42fb9e52d155547e6cf18cf26bce3e1a6af4ea (patch)
tree508c0c1d009f20621dad80a6c08f60ca4909b3b4 /drivers/nfc/nfcmrvl
parent52fdede5c9b96de355ab5e45e35503b9da6b86f6 (diff)
downloadlinux-ca42fb9e52d155547e6cf18cf26bce3e1a6af4ea.tar.xz
NFC: nfcmrvl: double free on error path
The nci_spi_send() function calls kfree_skb(skb) on both error and success so this extra kfree_skb() is a double free. Fixes: caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'drivers/nfc/nfcmrvl')
-rw-r--r--drivers/nfc/nfcmrvl/spi.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/nfc/nfcmrvl/spi.c b/drivers/nfc/nfcmrvl/spi.c
index e2881b15ce6c..8e0ddb434770 100644
--- a/drivers/nfc/nfcmrvl/spi.c
+++ b/drivers/nfc/nfcmrvl/spi.c
@@ -95,10 +95,9 @@ static int nfcmrvl_spi_nci_send(struct nfcmrvl_private *priv,
/* Send the SPI packet */
err = nci_spi_send(drv_data->nci_spi, &drv_data->handshake_completion,
skb);
- if (err != 0) {
+ if (err)
nfc_err(priv->dev, "spi_send failed %d", err);
- kfree_skb(skb);
- }
+
return err;
}