lkml.org 
[lkml]   [2021]   [Jun]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] staging: rtl8723bs: Fix uninitialized variable
On Sun, Jun 06, 2021 at 11:46:38AM -0700, Wenli Looi wrote:
> Uninitialized struct with invalid pointer causes BUG and prevents access
> point from working. Access point works once I apply this patch.
>
> This problem seems to have been present from the time the driver was
> added to staging. Most users probably do not use access point so they
> will not encounter this bug.
>
> https://forum.armbian.com/topic/14727-wifi-ap-kernel-bug-in-kernel-5444/
> has more details.
>
> kzalloc() seems to be what other drivers are doing in the same situation
> of creating struct station_info and calling cfg80211_new_sta. In
> particular, other drivers like ath6kl and mwifiex will silently return
> when kzalloc fails, so this seems like the right behavior. (mwifiex
> returns -ENOMEM from the place kzalloc is called, but if you follow the
> chain of calls, the return value is ultimately ignored)
>
> Links to same situation in other drivers:
> https://github.com/torvalds/linux/blob/f5b6eb1e018203913dfefcf6fa988649ad11ad6e/drivers/net/wireless/ath/ath6kl/main.c#L488
> https://github.com/torvalds/linux/blob/f5b6eb1e018203913dfefcf6fa988649ad11ad6e/drivers/net/wireless/marvell/mwifiex/uap_event.c#L120
>
> Signed-off-by: Wenli Looi <wlooi@ucalgary.ca>
> ---
>
> v1 -> v2: Switched from large stack variable to kzalloc


Nah, v1 was better, it just needs an updated commit message. See my
other email for more details.

regards,
dan carpenter

\
 
 \ /
  Last update: 2021-06-07 10:37    [W:0.085 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site