lkml.org 
[lkml]   [2021]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] staging: r8188eu: Use kzalloc() with GFP_ATOMIC in atomic context
Date
On Monday, November 1, 2021 4:11:26 PM CET Larry Finger wrote:
> On 11/1/21 09:27, Fabio M. De Francesco wrote:
> > Use the GFP_ATOMIC flag of kzalloc() with two memory allocation in
> > report_del_sta_event(). This function is called while holding spinlocks,
> > therefore it is not allowed to sleep. With the GFP_ATOMIC type flag, the
> > allocation is high priority and must not sleep.
> >
> > This issue is detected by Smatch which emits the following warning:
> > "drivers/staging/r8188eu/core/rtw_mlme_ext.c:6848 report_del_sta_event()
> > warn: sleeping in atomic context".
> >
> > []
> >
> I am happy that you caught the error before it destroyed every instance of
> r8188eu.

I don't think so, since we have run this driver with no problems at all :)

SAC bugs can potentially cause serious system hangs at runtime, but they do
not always cause problems in real execution as you have noticed here with
this driver. We have used and tested it hundreds of times with no problems.

> Incidentally, I disagree with checkpatch in that I think that
> sizeof(struct foo) is more descriptive than sizeof(*bar).

I agree with you in full, but I felt that I had to change it just because of
the warning output by that tool. I don't like to have my patches discarded
because they don't fix checkpatch warnings or introduce new ones.

> If I wanted to check
> the resulting value of the sizeof(), the second form requires an additional
> step. It probably does not matter much to the compiler, but when I have to
do it
> manually, the extra effort is not negligible.
>
> Even though I disagree with the philosophy,
>
> Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
>

Thanks for your "Acked-by" tag.

Fabio




\
 
 \ /
  Last update: 2021-11-01 17:31    [W:0.058 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site