diff options
author | Oleksij Rempel <[email protected]> | 2024-11-16 14:05:57 +0100 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2024-11-24 16:28:57 -0800 |
commit | 03819abbeb11117dcbba40bfe322b88c0c88a6b6 (patch) | |
tree | 3cdd14b0c71e120736ce84a0aeabaa93b3e9bee0 /drivers/fpga/fpga-mgr.c | |
parent | f26a29a038ee3982099e867bec2260576a19720f (diff) |
net: usb: lan78xx: Fix double free issue with interrupt buffer allocation
In lan78xx_probe(), the buffer `buf` was being freed twice: once
implicitly through `usb_free_urb(dev->urb_intr)` with the
`URB_FREE_BUFFER` flag and again explicitly by `kfree(buf)`. This caused
a double free issue.
To resolve this, reordered `kmalloc()` and `usb_alloc_urb()` calls to
simplify the initialization sequence and removed the redundant
`kfree(buf)`. Now, `buf` is allocated after `usb_alloc_urb()`, ensuring
it is correctly managed by `usb_fill_int_urb()` and freed by
`usb_free_urb()` as intended.
Fixes: a6df95cae40b ("lan78xx: Fix memory allocation bug")
Cc: John Efstathiades <[email protected]>
Signed-off-by: Oleksij Rempel <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'drivers/fpga/fpga-mgr.c')
0 files changed, 0 insertions, 0 deletions