Commit ca42fb9e authored by Dan Carpenter's avatar Dan Carpenter Committed by Samuel Ortiz

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: caf6e49b ("NFC: nfcmrvl: add spi driver")
Signed-off-by: default avatarDan Carpenter <[email protected]>
Signed-off-by: default avatarSamuel Ortiz <[email protected]>
parent 52fdede5
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment