[PATCH 1/1] char/agp: remove checks around pci_dev_put

From: Maninder Singh
Date: Thu Jun 25 2015 - 06:08:03 EST


No need of explicit check around pci_dev_put,
It handles with NULL pointer itself.

Signed-off-by: Maninder Singh <maninder1.s@xxxxxxxxxxx>
Reviewed-by: Akhilesh Kumar <akhilesh.k@xxxxxxxxxxx>
---
drivers/char/agp/intel-gtt.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 0b4188b..78d35fa 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -1430,10 +1430,8 @@ void intel_gmch_remove(void)
if (--intel_private.refcount)
return;

- if (intel_private.pcidev)
- pci_dev_put(intel_private.pcidev);
- if (intel_private.bridge_dev)
- pci_dev_put(intel_private.bridge_dev);
+ pci_dev_put(intel_private.pcidev);
+ pci_dev_put(intel_private.bridge_dev);
intel_private.driver = NULL;
}
EXPORT_SYMBOL(intel_gmch_remove);
--
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/