diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2021-12-17 18:03:12 +0300 |
---|---|---|
committer | Kalle Valo <kvalo@kernel.org> | 2021-12-20 21:44:03 +0300 |
commit | 4894edacfa93d7046bec4fc61fc402ac6a2ac9e8 (patch) | |
tree | 6886541ab62427cfe9bc68561504c56f36dcfa55 /drivers/net/wireless/realtek/rtw88/rtw8822c.c | |
parent | 97c0979d0d729cded6eae0d7b22d06a2eeeca3a4 (diff) | |
download | linux-4894edacfa93d7046bec4fc61fc402ac6a2ac9e8.tar.xz |
wilc1000: fix double free error in probe()
Smatch complains that there is a double free in probe:
drivers/net/wireless/microchip/wilc1000/spi.c:186 wilc_bus_probe() error: double free of 'spi_priv'
drivers/net/wireless/microchip/wilc1000/sdio.c:163 wilc_sdio_probe() error: double free of 'sdio_priv'
The problem is that wilc_netdev_cleanup() function frees "wilc->bus_data".
That's confusing and a layering violation. Leave the frees in probe(),
delete the free in wilc_netdev_cleanup(), and add some new frees to the
remove() functions.
Fixes: dc8b338f3bcd ("wilc1000: use goto labels on error path")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20211217150311.GC16611@kili
Diffstat (limited to 'drivers/net/wireless/realtek/rtw88/rtw8822c.c')
0 files changed, 0 insertions, 0 deletions