Re: [PATCH RFC] mm: warn potential return NULL for kmalloc_array and kvmalloc_array with __GFP_NOFAIL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 19, 2024 at 7:37 PM Christoph Hellwig <hch@xxxxxxxxxxxxx> wrote:
>
> On Fri, Jul 19, 2024 at 09:02:01AM +0200, Michal Hocko wrote:
> > > Additionally, at least drivers/vdpa/vdpa_user/iova_domain.c is
> > > incorrect with GFP_ATOMIC
> > > | __GFP_NOFAIL.
> >
> > This is broken! Please bring this up with the maintainer of the code.
>
> No the only issue in this vdpa mess :(
>
> But I wonder if we should have a macro/BUILD_BUG_ON magic to catch
> totally obvious bugs like this.

I doubt this is going to work as users can use a variant to save gfp_flags.
On the other hand, isn't it necessarily a bug of vdpa, why can't it be mm?

if mm disallows GFP_NOFAIL,  there must be a doc to say that; if it allows,
we should never return NULL.

>





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux