diff --git a/drivers/base/node.c b/drivers/base/node.c index bc9f43bf7e29a46714cb1f220bb0d866c5d3eab8..8f7ed9933a7c6939d7703badeeacb97fcfc803aa 100644 --- a/drivers/base/node.c +++ b/drivers/base/node.c @@ -599,7 +599,11 @@ int register_one_node(int nid) void unregister_one_node(int nid) { + if (!node_devices[nid]) + return; + unregister_node(node_devices[nid]); + kfree(node_devices[nid]); node_devices[nid] = NULL; }