From: Antonino A. Daplas Date: Tue, 3 Oct 2006 08:14:53 +0000 (-0700) Subject: [PATCH] nvidiafb: Honor the return value of pci_enable_device X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7b566b1f7bdbbcfa8d11b8018c6dec5467f7c62b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] nvidiafb: Honor the return value of pci_enable_device Check the return value of pci_enable_device(). Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/video/nvidia/nvidia.c b/drivers/video/nvidia/nvidia.c index f8cd4c519aeb..731edf7cb0a0 100644 --- a/drivers/video/nvidia/nvidia.c +++ b/drivers/video/nvidia/nvidia.c @@ -984,7 +984,10 @@ static int nvidiafb_resume(struct pci_dev *dev) if (par->pm_state != PM_EVENT_FREEZE) { pci_restore_state(dev); - pci_enable_device(dev); + + if (pci_enable_device(dev)) + goto fail; + pci_set_master(dev); } @@ -993,6 +996,7 @@ static int nvidiafb_resume(struct pci_dev *dev) fb_set_suspend (info, 0); nvidiafb_blank(FB_BLANK_UNBLANK, info); +fail: release_console_sem(); return 0; }