]> git.baikalelectronics.ru Git - kernel.git/commit
rtw89: Fix variable dereferenced before check 'sta'
authorPing-Ke Shih <pkshih@realtek.com>
Fri, 22 Oct 2021 06:12:42 +0000 (14:12 +0800)
committerKalle Valo <kvalo@codeaurora.org>
Wed, 27 Oct 2021 07:37:59 +0000 (10:37 +0300)
commitd51d6c2795151d04b1a547aa9c363e263f5843d2
treefe954f1d06e1775e7bfaa4a4e01bbcf3dabe698a
parent3cc43e134e881404b8071f67e48d66f172fdb35d
rtw89: Fix variable dereferenced before check 'sta'

The pointer rtwsta is dereferencing pointer sta before sta is being null
checked. Fix this by assigning sta->drv_priv to rtwsta only if sta is not
NULL, otherwise just NULL.

Fixes: 9c5adf19c17c ("rtw89: add Realtek 802.11ax driver")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211022061242.8383-1-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/core.c