summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/pci_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/pci_user.c')
-rw-r--r--sys/dev/pci/pci_user.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/pci/pci_user.c b/sys/dev/pci/pci_user.c
index 0af05a9..b7ae55a 100644
--- a/sys/dev/pci/pci_user.c
+++ b/sys/dev/pci/pci_user.c
@@ -467,7 +467,7 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
/* Populate pd_name and pd_unit */
name = NULL;
- if (dinfo->cfg.dev && dinfo->conf.pd_name[0] == '\0')
+ if (dinfo->cfg.dev)
name = device_get_name(dinfo->cfg.dev);
if (name) {
strncpy(dinfo->conf.pd_name, name,
@@ -475,6 +475,9 @@ pci_ioctl(struct cdev *dev, u_long cmd, caddr_t data, int flag, struct thread *t
dinfo->conf.pd_name[PCI_MAXNAMELEN] = 0;
dinfo->conf.pd_unit =
device_get_unit(dinfo->cfg.dev);
+ } else {
+ dinfo->conf.pd_name[0] = '\0';
+ dinfo->conf.pd_unit = 0;
}
#ifdef PRE7_COMPAT
OpenPOWER on IntegriCloud