Re: [PATCH] staging: rtl8723bs: Fix two possible sleep-in-atomic-context bugs in translate_scan()

From: Dan Carpenter
Date: Wed Jun 20 2018 - 06:23:27 EST


On Wed, Jun 20, 2018 at 06:05:06PM +0800, Jia-Ju Bai wrote:
> > Thanks! It occurs to me that another way to detect this bug is that
> > one of the allocations in this function already uses GFP_ATOMIC. It
> > doesn't normally make sense to mix GFP_ATOMIC and GFP_KERNEL when there
> > isn't any locking in the function.
>
> Yes, this pattern is interesting for bug finding :)
> But to fix the bugs of this pattern, we need to decide whether GFP_ATOMIC or
> GFP_KERNEL should be used here.
>

Sure. But either way it's a bug. Plus this would be the first static
checker warning which warns about using GFP_ATOMIC when it's supposed to
be GFP_KERNEL. #milestone

regards,
dan carpenter