diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2017-03-08 08:22:37 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2017-04-02 00:09:17 +0200 |
commit | ca42fb9e52d155547e6cf18cf26bce3e1a6af4ea (patch) | |
tree | 508c0c1d009f20621dad80a6c08f60ca4909b3b4 /drivers/nfc | |
parent | 52fdede5c9b96de355ab5e45e35503b9da6b86f6 (diff) | |
download | linux-ca42fb9e52d155547e6cf18cf26bce3e1a6af4ea.tar.bz2 |
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')
-rw-r--r-- | drivers/nfc/nfcmrvl/spi.c | 5 |
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; } |