[PATCH 8/8] Revert "staging: gasket: core: hold reference to pci_dev while used"

From: Todd Poynor
Date: Thu Aug 02 2018 - 12:03:03 EST


From: Todd Poynor <toddpoynor@xxxxxxxxxx>

There's no need to take an additional reference on the pci_dev structure
for the pointer copy saved in gasket data structures.

This reverts commit 8dd8a48b9a7dae5493494a8603adddfdf1914716.

Reported-by: Dmitry Torokhov <dtor@xxxxxxxxxxxx>
Signed-off-by: Todd Poynor <toddpoynor@xxxxxxxxxx>
---
drivers/staging/gasket/gasket_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/gasket/gasket_core.c b/drivers/staging/gasket/gasket_core.c
index 99994e30b154b..8c5574305f13b 100644
--- a/drivers/staging/gasket/gasket_core.c
+++ b/drivers/staging/gasket/gasket_core.c
@@ -253,7 +253,6 @@ static void gasket_free_dev(struct gasket_dev *gasket_dev)
internal_desc->devs[gasket_dev->dev_idx] = NULL;
mutex_unlock(&internal_desc->mutex);
put_device(gasket_dev->dev);
- pci_dev_put(gasket_dev->pci_dev);
kfree(gasket_dev);
}

@@ -1475,7 +1474,7 @@ static int gasket_pci_probe(struct pci_dev *pci_dev,
ret = gasket_alloc_dev(internal_desc, parent, &gasket_dev, kobj_name);
if (ret)
return ret;
- gasket_dev->pci_dev = pci_dev_get(pci_dev);
+ gasket_dev->pci_dev = pci_dev;
if (IS_ERR_OR_NULL(gasket_dev->dev_info.device)) {
pr_err("gasket: Cannot create %s device %s [ret = %ld]\n",
driver_desc->name, gasket_dev->dev_info.name,
--
2.18.0.597.ga71716f1ad-goog