[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180729193646.201721-4-toddpoynor@gmail.com>
Date: Sun, 29 Jul 2018 12:36:36 -0700
From: Todd Poynor <toddpoynor@...il.com>
To: Rob Springer <rspringer@...gle.com>,
John Joseph <jnjoseph@...gle.com>,
Ben Chan <benchan@...omium.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
Dmitry Torokhov <dtor@...omium.org>,
Todd Poynor <toddpoynor@...gle.com>
Subject: [PATCH 03/13] staging: gasket: page table: hold references to device and pci_dev
From: Todd Poynor <toddpoynor@...gle.com>
Hold references to the struct device and the pci_dev for the page table
while the data structures contian pointers to these.
Signed-off-by: Todd Poynor <toddpoynor@...gle.com>
---
drivers/staging/gasket/gasket_page_table.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/gasket/gasket_page_table.c b/drivers/staging/gasket/gasket_page_table.c
index b9304d221722b..6b946a155ee3a 100644
--- a/drivers/staging/gasket/gasket_page_table.c
+++ b/drivers/staging/gasket/gasket_page_table.c
@@ -345,8 +345,8 @@ int gasket_page_table_init(
bar_data->virt_base[page_table_config->base_reg]);
pg_tbl->extended_offset_reg = (u64 __iomem *)&(
bar_data->virt_base[page_table_config->extended_reg]);
- pg_tbl->device = device;
- pg_tbl->pci_dev = pci_dev;
+ pg_tbl->device = get_device(device);
+ pg_tbl->pci_dev = pci_dev_get(pci_dev);
dev_dbg(device, "Page table initialized successfully\n");
@@ -364,6 +364,8 @@ void gasket_page_table_cleanup(struct gasket_page_table *pg_tbl)
vfree(pg_tbl->entries);
pg_tbl->entries = NULL;
+ put_device(pg_tbl->device);
+ pci_dev_put(pg_tbl->pci_dev);
kfree(pg_tbl);
}
--
2.18.0.345.g5c9ce644c3-goog
Powered by blists - more mailing lists