From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Phillip Potter <phil@philpotter.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Larry Finger <Larry.Finger@lwfinger.net>
Subject: Re: [PATCH v2] staging: r8188eu: Use kzalloc() with GFP_ATOMIC in atomic context
Date: Mon, 01 Nov 2021 17:30:47 +0100 [thread overview]
Message-ID: <11283844.I1tDBM3C2B@localhost.localdomain> (raw)
In-Reply-To: <d1a8eb91-adb9-2163-dc3d-9f86ebdc45e3@lwfinger.net>
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
next prev parent reply other threads:[~2021-11-01 16:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-01 14:27 [PATCH v2] staging: r8188eu: Use kzalloc() with GFP_ATOMIC in atomic context Fabio M. De Francesco
2021-11-01 15:11 ` Larry Finger
2021-11-01 16:30 ` Fabio M. De Francesco [this message]
2021-11-01 16:42 ` Joe Perches
2021-11-01 15:18 ` Greg Kroah-Hartman
2021-11-01 16:43 ` Fabio M. De Francesco
2021-11-02 7:43 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11283844.I1tDBM3C2B@localhost.localdomain \
--to=fmdefrancesco@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox