mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-19 10:44:14 +08:00
mm/memory_hotplug.c: add NULL check to avoid potential NULL pointer dereference
The NULL check at line 1226: if (!pgdat), implies that pointer pgdat might be NULL. rollback_node_hotadd() dereferences this pointer. Add NULL check to avoid a potential NULL pointer dereference. Addresses-Coverity-ID: 1369133 Link: http://lkml.kernel.org/r/20170530212436.GA6195@embeddedgus Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0622622677
commit
dbac61a3f2
@ -1268,7 +1268,7 @@ register_fail:
|
||||
|
||||
error:
|
||||
/* rollback pgdat allocation and others */
|
||||
if (new_pgdat)
|
||||
if (new_pgdat && pgdat)
|
||||
rollback_node_hotadd(nid, pgdat);
|
||||
memblock_remove(start, size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user