Re: struct dev_pagemap corruption

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

 



On Fri, Apr 5, 2019 at 7:54 AM Anshuman Khandual
<anshuman.khandual@xxxxxxx> wrote:
[..]
> > Given that what seems to ultimately get corrupted is the memory pointed to by pgmap here, how is *that* being allocated?
>
> struct dev_pagemap *pgmap;
>
> pgmap = devm_kzalloc(dev, sizeof(struct dev_pagemap), GFP_KERNEL);
>
> Is it problematic to use dev_kzalloc here instead of generic kmalloc/kzalloc
> functions ?

On this specific question, no. devm_kzalloc() is how the pmem and
device-dax drivers allocate the pgmap passed to devm_memremap_pages().
The unwind order of the devres resources ensures that the
devm_memremap_pages() devres actions occur before the release of the
pgmap allocation.




[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