forked from Minki/linux
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: caf6e49bf6
("NFC: nfcmrvl: add spi driver")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
This commit is contained in:
parent
52fdede5c9
commit
ca42fb9e52
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user