Skip to content

Commit

Permalink
rtw88: don't treat NULL pointer as an array
Browse files Browse the repository at this point in the history
I'm not a standards expert, but this really looks to be undefined
behavior, when chip->dig_cck may be NULL. (And, we're trying to do a
NULL check a few lines down, because some chip variants will use NULL.)

Fixes: fc637a8 ("rtw88: 8723d: Set IG register for CCK rate")
Signed-off-by: Brian Norris <[email protected]>
Acked-by: Yan-Hsuan Chuang <[email protected]>
Signed-off-by: Kalle Valo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
  • Loading branch information
computersforpeace authored and Kalle Valo committed Aug 27, 2020
1 parent 5466aff commit 22b726c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/net/wireless/realtek/rtw88/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,12 +147,13 @@ void rtw_phy_dig_write(struct rtw_dev *rtwdev, u8 igi)
{
struct rtw_chip_info *chip = rtwdev->chip;
struct rtw_hal *hal = &rtwdev->hal;
const struct rtw_hw_reg *dig_cck = &chip->dig_cck[0];
u32 addr, mask;
u8 path;

if (dig_cck)
if (chip->dig_cck) {
const struct rtw_hw_reg *dig_cck = &chip->dig_cck[0];
rtw_write32_mask(rtwdev, dig_cck->addr, dig_cck->mask, igi >> 1);
}

for (path = 0; path < hal->rf_path_num; path++) {
addr = chip->dig[path].addr;
Expand Down

0 comments on commit 22b726c

Please sign in to comment.