Message ID | 1527768879-88161-3-git-send-email-xiexiuqi@huawei.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/include/linux/device.h b/include/linux/device.h index 4779569..2a4fb08 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -1017,7 +1017,12 @@ extern __printf(2, 3) #ifdef CONFIG_NUMA static inline int dev_to_node(struct device *dev) { - return dev->numa_node; + int node = dev->numa_node; + + if (unlikely(node != NUMA_NO_NODE && !node_online(node))) + return NUMA_NO_NODE; + + return node; } static inline void set_dev_node(struct device *dev, int node) {