NFC: nfcmrvl: double free on error path
Subsystems (2)
PATCH 1/1 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.
---
Static analysis. Not tested.
drivers/nfc/nfcmrvl/spi.c +2 -3
@@ -96,10 +96,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; }
Samuel Ortiz
AppliedHi Dan,
Quoted 7 lines · Dan Carpenter
The
nci_spi_send()function callskfree_skb(skb)on both error and success so this extrakfree_skb()is a double free.Fixes caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver")Signed-off-by Dan Carpenter <[email protected]>---
Static analysis. Not tested.
Applied to nfc-next, thanks.
Cheers,
Samuel.
Quoted 12 lines · Samuel Ortiz
Hi Dan,
Quoted 7 lines · Dan Carpenter
The
nci_spi_send()function callskfree_skb(skb)on both error and success so this extrakfree_skb()is a double free.Fixes caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver")Signed-off-by Dan Carpenter <[email protected]>---
Static analysis. Not tested.Applied to nfc-next, thanks.
This is still not showing up in linux-next.
regards,
dan carpenter
Quoted 7 lines · Dan Carpenter
Quoted 6 lines · Samuel Ortiz
Hi Dan,
Quoted 3 lines · Dan Carpenter
The
nci_spi_send()function callskfree_skb(skb)on both error and success so this extrakfree_skb()is a double free.
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Fixes caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver")Signed-off-by Dan Carpenter <[email protected]>---
Static analysis. Not tested.Applied to nfc-next, thanks.
This is still not showing up in linux-next.
I sent a pending pull request containing it.
Cheers,
Samuel
Quoted 12 lines · Samuel Ortiz
Quoted 11 lines · Dan Carpenter
Quoted 10 lines · Samuel Ortiz
Hi Dan,
Quoted 7 lines · Dan Carpenter
The
nci_spi_send()function callskfree_skb(skb)on both error and success so this extrakfree_skb()is a double free.Fixes caf6e49bf6d0 ("NFC: nfcmrvl: add spi driver")Signed-off-by Dan Carpenter <[email protected]>---
Static analysis. Not tested.
Quoted 5 lines
Quoted 4 lines
Quoted 2 lines
Applied to nfc-next, thanks.
This is still not showing up in linux-next.
I sent a pending pull request containing it.
Ah. Sorry for the noise. I didn't realize your tree didn't feed into linux-next directly. Perhaps it should, though?
regards,
dan carpenter