nfc: Fix potential memory leak of skb
Status from this message: This series was applied to netdev/net.git (master)
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 All 4 applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | nfc: fdp: Fix potential memory leak in fdp_nci_send()drivers/ | +9 | 0 replies | Applied |
| 2/4 | nfc: nxp-nci: Fix potential memory leak in nxp_nci_send()drivers/ | +5 | 0 replies | Applied |
| 3/4 | nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()drivers/ | +6 | 0 replies | Applied |
| 4/4 | nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send()drivers/ | +6 | 0 replies | Applied |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 0/4] nfc: Fix potential memory leak of skb
There are 6 kinds of send functions can be called by nci_send_frame():
virtual_nci_send(), fdp_nci_send(), nxp_nci_send(), s3fwrn5_nci_send(), nfcmrvl_nci_send(), st_nci_send();
1. virtual_nci_send() will memleak the skb, and has been fixed before.
2. fdp_nci_send() won't free the skb no matter whether write() succeed.
3-4. nxp_nci_send() and s3fwrn5_nci_send() will only free the skb when write() failed, however write() will not free the skb by itself for when succeeds.
5. nfcmrvl_nci_send() will call nfcmrvl_XXX_nci_send(), where some of them will free the skb, but nfcmrvl_i2c_nci_send() only free the skb when i2c_master_send() return >=0, and memleak will happen when i2c_master_send() failed in nfcmrvl_i2c_nci_send().
6. st_nci_send() will queue the skb into other list and finally be freed.
Fix the potential memory leak of skb.
Shang XiaoJing (4):
nfc: fdp: Fix potential memory leak in fdp_nci_send()
nfc: nxp-nci: Fix potential memory leak in nxp_nci_send()
nfc: s3fwrn5: Fix potential memory leak in s3fwrn5_nci_send()
nfc: nfcmrvl: Fix potential memory leak in nfcmrvl_i2c_nci_send()
drivers/nfc/fdp/fdp.c | 10 +++++++++- drivers/nfc/nfcmrvl/i2c.c | 7 ++++++- drivers/nfc/nxp-nci/core.c | 7 +++++-- drivers/nfc/s3fwrn5/core.c | 8 ++++++-- 4 files changed, 26 insertions(+), 6 deletions(-)
Signature · 1 line
2.17.1