Skip to content
Commit c32e118d authored by Sascha Hauer's avatar Sascha Hauer Committed by Greg Kroah-Hartman
Browse files

wifi: rtw88: usb: kill and free rx urbs on probe failure

commit 29056436 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: a82dfd33

 ("wifi: rtw88: Add common USB chip support")
Cc: stable@vger.kernel.org
Reported-by: default avatarIlgaz Öcal <ilgaz@ilgaz.gen.tr>
Signed-off-by: default avatarSascha Hauer <s.hauer@pengutronix.de>
Acked-by: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Acked-by: default avatarPing-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20230823075021.588596-1-s.hauer@pengutronix.de
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e74778e9
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment