diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index 8cb59433c2e7..4a36158c8996 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1333,8 +1333,10 @@ pci_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; } diff --git a/sys/isa/isa_common.c b/sys/isa/isa_common.c index 42d486e940e7..92027544859b 100644 --- a/sys/isa/isa_common.c +++ b/sys/isa/isa_common.c @@ -869,8 +869,10 @@ isa_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; } diff --git a/sys/pccard/pccard_nbk.c b/sys/pccard/pccard_nbk.c index 264b96e28545..b0913633ddb1 100644 --- a/sys/pccard/pccard_nbk.c +++ b/sys/pccard/pccard_nbk.c @@ -178,8 +178,10 @@ pccard_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; } diff --git a/sys/pci/pci.c b/sys/pci/pci.c index 8cb59433c2e7..4a36158c8996 100644 --- a/sys/pci/pci.c +++ b/sys/pci/pci.c @@ -1333,8 +1333,10 @@ pci_get_resource(device_t dev, device_t child, int type, int rid, if (!rle) return ENOENT; - *startp = rle->start; - *countp = rle->count; + if (startp) + *startp = rle->start; + if (countp) + *countp = rle->count; return 0; }