aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDexuan Cui <[email protected]>2018-03-15 14:21:43 +0000
committerLorenzo Pieralisi <[email protected]>2018-03-16 18:19:02 +0000
commitfca288c0153b2b97114b9081bc3c33c3735145b6 (patch)
treec244bf8dc1dcc76f3012da68df50d7ee7aa05bd6
parentdf3f2159f4e4146d40b244725ce79ed921530b99 (diff)
PCI: hv: Remove the bogus test in hv_eject_device_work()
When kernel is executing hv_eject_device_work(), hpdev->state value must be hv_pcichild_ejecting; any other value would consist in a bug, therefore replace the bogus check with an explicit WARN_ON() on the condition failure detection. Signed-off-by: Dexuan Cui <[email protected]> [[email protected]: updated commit log] Signed-off-by: Lorenzo Pieralisi <[email protected]> Reviewed-by: Michael Kelley <[email protected]> Acked-by: Haiyang Zhang <[email protected]> Cc: Vitaly Kuznetsov <[email protected]> Cc: Jack Morgenstein <[email protected]> Cc: Stephen Hemminger <[email protected]> Cc: K. Y. Srinivasan <[email protected]>
-rw-r--r--drivers/pci/host/pci-hyperv.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/pci/host/pci-hyperv.c b/drivers/pci/host/pci-hyperv.c
index 0d2a09833a05..0dc2ecdbbe45 100644
--- a/drivers/pci/host/pci-hyperv.c
+++ b/drivers/pci/host/pci-hyperv.c
@@ -1842,10 +1842,7 @@ static void hv_eject_device_work(struct work_struct *work)
hpdev = container_of(work, struct hv_pci_dev, wrk);
- if (hpdev->state != hv_pcichild_ejecting) {
- put_pcichild(hpdev, hv_pcidev_ref_pnp);
- return;
- }
+ WARN_ON(hpdev->state != hv_pcichild_ejecting);
/*
* Ejection can come before or after the PCI bus has been set up, so