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@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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");
vfree(pg_tbl->entries);
pg_tbl->entries = NULL;
+ put_device(pg_tbl->device);
+ pci_dev_put(pg_tbl->pci_dev);
kfree(pg_tbl);
}