Re: [PATCH] kernel/memremap: Remove stale devres_free() call

2018-03-06 Thread Dan Williams
On Tue, Mar 6, 2018 at 8:55 AM, Logan Gunthorpe  wrote:
>
>
> On 05/03/18 09:56 PM, Oliver O'Halloran wrote:
>>
>> devm_memremap_pages() was re-worked in e8d513483300 to take a caller
>> allocated struct dev_pagemap as a function parameter. A call to
>> devres_free() was left in the error cleanup path which results in
>> a kernel panic if the remap fails for some reason. Remove it
>> to fix the panic and let devm_memremap_pages() fail gracefully.
>>
>> Fixes: e8d513483300 ("memremap: change devm_memremap_pages interface to
>> use struct dev_pagemap")
>> Cc: Logan Gunthorpe 
>> Cc: Christoph Hellwig 
>> Cc: Dan Williams 
>> Signed-off-by: Oliver O'Halloran 
>
>
> Reviewed-by: Logan Gunthorpe 

Thanks, applied.


Re: [PATCH] kernel/memremap: Remove stale devres_free() call

2018-03-06 Thread Dan Williams
On Tue, Mar 6, 2018 at 8:55 AM, Logan Gunthorpe  wrote:
>
>
> On 05/03/18 09:56 PM, Oliver O'Halloran wrote:
>>
>> devm_memremap_pages() was re-worked in e8d513483300 to take a caller
>> allocated struct dev_pagemap as a function parameter. A call to
>> devres_free() was left in the error cleanup path which results in
>> a kernel panic if the remap fails for some reason. Remove it
>> to fix the panic and let devm_memremap_pages() fail gracefully.
>>
>> Fixes: e8d513483300 ("memremap: change devm_memremap_pages interface to
>> use struct dev_pagemap")
>> Cc: Logan Gunthorpe 
>> Cc: Christoph Hellwig 
>> Cc: Dan Williams 
>> Signed-off-by: Oliver O'Halloran 
>
>
> Reviewed-by: Logan Gunthorpe 

Thanks, applied.


Re: [PATCH] kernel/memremap: Remove stale devres_free() call

2018-03-06 Thread Logan Gunthorpe



On 05/03/18 09:56 PM, Oliver O'Halloran wrote:

devm_memremap_pages() was re-worked in e8d513483300 to take a caller
allocated struct dev_pagemap as a function parameter. A call to
devres_free() was left in the error cleanup path which results in
a kernel panic if the remap fails for some reason. Remove it
to fix the panic and let devm_memremap_pages() fail gracefully.

Fixes: e8d513483300 ("memremap: change devm_memremap_pages interface to use struct 
dev_pagemap")
Cc: Logan Gunthorpe 
Cc: Christoph Hellwig 
Cc: Dan Williams 
Signed-off-by: Oliver O'Halloran 


Reviewed-by: Logan Gunthorpe 


---
Both in-tree users of devm_memremap_pages() embed dev_pagemap into other
structures so this shouldn't cause any leaks. Logan's p2p series does
add one usage that assumes pgmap will be freed on error so that'll
need fixing.


Yup, nice catch! I'll fix that for the next series.

Thanks,

Logan


Re: [PATCH] kernel/memremap: Remove stale devres_free() call

2018-03-06 Thread Logan Gunthorpe



On 05/03/18 09:56 PM, Oliver O'Halloran wrote:

devm_memremap_pages() was re-worked in e8d513483300 to take a caller
allocated struct dev_pagemap as a function parameter. A call to
devres_free() was left in the error cleanup path which results in
a kernel panic if the remap fails for some reason. Remove it
to fix the panic and let devm_memremap_pages() fail gracefully.

Fixes: e8d513483300 ("memremap: change devm_memremap_pages interface to use struct 
dev_pagemap")
Cc: Logan Gunthorpe 
Cc: Christoph Hellwig 
Cc: Dan Williams 
Signed-off-by: Oliver O'Halloran 


Reviewed-by: Logan Gunthorpe 


---
Both in-tree users of devm_memremap_pages() embed dev_pagemap into other
structures so this shouldn't cause any leaks. Logan's p2p series does
add one usage that assumes pgmap will be freed on error so that'll
need fixing.


Yup, nice catch! I'll fix that for the next series.

Thanks,

Logan


Re: [PATCH] kernel/memremap: Remove stale devres_free() call

2018-03-06 Thread Christoph Hellwig
Looks good,

Reviewed-by: Christoph Hellwig 


Re: [PATCH] kernel/memremap: Remove stale devres_free() call

2018-03-06 Thread Christoph Hellwig
Looks good,

Reviewed-by: Christoph Hellwig