Re: [PATCH 2/2] mm: don't hide potentially null memmap pointer in sparse_remove_section

2019-08-27 Thread Michal Hocko
On Tue 27-08-19 17:00:16, Alastair D'Silva wrote: [...] > The NULL check was added in commit: > 95a4774d055c ("memory-hotplug: update mce_bad_pages when removing the > memory") > where memmap was originally inited to NULL, and only conditionally > given a value. > > With this in mind, since that

Re: [PATCH 2/2] mm: don't hide potentially null memmap pointer in sparse_remove_section

2019-08-27 Thread David Hildenbrand
On 27.08.19 09:00, Alastair D'Silva wrote: > On Tue, 2019-08-27 at 08:24 +0200, Michal Hocko wrote: >> On Tue 27-08-19 15:36:55, Alastair D'Silva wrote: >>> From: Alastair D'Silva >>> >>> By adding offset to memmap before passing it in to >>> clear_hwpoisoned_pages, >>> we hide a theoretically

Re: [PATCH 2/2] mm: don't hide potentially null memmap pointer in sparse_remove_section

2019-08-27 Thread Alastair D'Silva
On Tue, 2019-08-27 at 08:24 +0200, Michal Hocko wrote: > On Tue 27-08-19 15:36:55, Alastair D'Silva wrote: > > From: Alastair D'Silva > > > > By adding offset to memmap before passing it in to > > clear_hwpoisoned_pages, > > we hide a theoretically null memmap from the null check inside > >

Re: [PATCH 2/2] mm: don't hide potentially null memmap pointer in sparse_remove_section

2019-08-27 Thread Michal Hocko
On Tue 27-08-19 15:36:55, Alastair D'Silva wrote: > From: Alastair D'Silva > > By adding offset to memmap before passing it in to clear_hwpoisoned_pages, > we hide a theoretically null memmap from the null check inside > clear_hwpoisoned_pages. Isn't that other way around? Calculating the

[PATCH 2/2] mm: don't hide potentially null memmap pointer in sparse_remove_section

2019-08-26 Thread Alastair D'Silva
From: Alastair D'Silva By adding offset to memmap before passing it in to clear_hwpoisoned_pages, we hide a theoretically null memmap from the null check inside clear_hwpoisoned_pages. This patch passes the offset to clear_hwpoisoned_pages instead, allowing memmap to successfully perform it's