Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PCI hotplug: fix get_##name return value problem

The commit 356a9d6f3dd283f83861adf1ac909879f0e66411 (PCI: fix hotplug
get_##name return value problem) doesn't seem to be merged properly.
Because of this, PCI hotplug no longer works (Read/Write PCI hotplug
files always returns -ENODEV).

This patch fixes wrong check of try_module_get() return value check in
get_##name().

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>

authored by

Kenji Kaneshige and committed by
Jesse Barnes
bd1d9855 e5665a45

+1 -1
+1 -1
drivers/pci/hotplug/pci_hotplug_core.c
··· 102 102 { \ 103 103 struct hotplug_slot_ops *ops = slot->ops; \ 104 104 int retval = 0; \ 105 - if (try_module_get(ops->owner)) \ 105 + if (!try_module_get(ops->owner)) \ 106 106 return -ENODEV; \ 107 107 if (ops->get_##name) \ 108 108 retval = ops->get_##name(slot, value); \