aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/pci-driver.c')
-rw-r--r--drivers/pci/pci-driver.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index e571c72e6753..e8d94fafc280 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -182,15 +182,18 @@ static int pci_call_probe(struct pci_driver *drv, struct pci_dev *dev,
182 struct mempolicy *oldpol; 182 struct mempolicy *oldpol;
183 cpumask_t oldmask = current->cpus_allowed; 183 cpumask_t oldmask = current->cpus_allowed;
184 int node = pcibus_to_node(dev->bus); 184 int node = pcibus_to_node(dev->bus);
185 if (node >= 0 && node_online(node)) 185
186 set_cpus_allowed(current, node_to_cpumask(node)); 186 if (node >= 0) {
187 node_to_cpumask_ptr(nodecpumask, node);
188 set_cpus_allowed_ptr(current, nodecpumask);
189 }
187 /* And set default memory allocation policy */ 190 /* And set default memory allocation policy */
188 oldpol = current->mempolicy; 191 oldpol = current->mempolicy;
189 current->mempolicy = NULL; /* fall back to system default policy */ 192 current->mempolicy = NULL; /* fall back to system default policy */
190#endif 193#endif
191 error = drv->probe(dev, id); 194 error = drv->probe(dev, id);
192#ifdef CONFIG_NUMA 195#ifdef CONFIG_NUMA
193 set_cpus_allowed(current, oldmask); 196 set_cpus_allowed_ptr(current, &oldmask);
194 current->mempolicy = oldpol; 197 current->mempolicy = oldpol;
195#endif 198#endif
196 return error; 199 return error;