]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
wifi: rtw88: usb: kill and free rx urbs on probe failure
authorSascha Hauer <s.hauer@pengutronix.de>
Wed, 23 Aug 2023 07:50:21 +0000 (09:50 +0200)
committerStefan Bader <stefan.bader@canonical.com>
Mon, 30 Oct 2023 11:00:33 +0000 (12:00 +0100)
commite6396abf5f4686f3ee33aaca82c57d230b767e17
treec46e1d6e1d8dcdf37deed801505ecb612cc53ba7
parent64c4ae99793fc69c1f4708c54cdfa38944cac4c4
wifi: rtw88: usb: kill and free rx urbs on probe failure

BugLink: https://bugs.launchpad.net/bugs/2039884
commit 290564367ab7fa7e2048bdc00d9c0ad016b41eea upstream.

After rtw_usb_alloc_rx_bufs() has been called rx urbs have been
allocated and must be freed in the error path. After rtw_usb_init_rx()
has been called they are submitted, so they also must be killed.

Add these forgotten steps to the probe error path.

Besides the lost memory this also fixes a problem when the driver
fails to download the firmware in rtw_chip_info_setup(). In this
case it can happen that the completion of the rx urbs handler runs
at a time when we already freed our data structures resulting in
a kernel crash.

Fixes: a82dfd33d123 ("wifi: rtw88: Add common USB chip support")
Cc: stable@vger.kernel.org
Reported-by: Ilgaz Ă–cal <ilgaz@ilgaz.gen.tr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Acked-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230823075021.588596-1-s.hauer@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/net/wireless/realtek/rtw88/usb.c