diff options
author | imp <imp@FreeBSD.org> | 2006-11-04 06:56:51 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2006-11-04 06:56:51 +0000 |
commit | c3cb71bca5b898abe8966c7c978b5313b753b27c (patch) | |
tree | 98db00ee2cf64ef86823e9249f9fbcdeac5695c7 | |
parent | eea32515548a614ccc783cdd01451caa38233e35 (diff) | |
download | FreeBSD-src-c3cb71bca5b898abe8966c7c978b5313b753b27c.zip FreeBSD-src-c3cb71bca5b898abe8966c7c978b5313b753b27c.tar.gz |
Doh! Actually commit checking against NULL for res.
Noticed by: dougb@
-rw-r--r-- | sys/dev/pci/pci.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/pci/pci.c b/sys/dev/pci/pci.c index c6dedb9..5c8076e 100644 --- a/sys/dev/pci/pci.c +++ b/sys/dev/pci/pci.c @@ -1323,6 +1323,8 @@ pci_add_map(device_t pcib, device_t bus, device_t dev, */ res = resource_list_alloc(rl, bus, dev, type, ®, start, end, count, prefetch ? RF_PREFETCHABLE : 0); + if (res == NULL) + return (barlen); start = rman_get_start(res); if ((u_long)start != start) { /* Wait a minute! this platform can't do this address. */ @@ -1332,11 +1334,9 @@ pci_add_map(device_t pcib, device_t bus, device_t dev, resource_list_release(rl, bus, dev, type, reg, res); return (barlen); } - if (res != NULL) { - pci_write_config(dev, reg, start, 4); - if (ln2range == 64) - pci_write_config(dev, reg + 4, start >> 32, 4); - } + pci_write_config(dev, reg, start, 4); + if (ln2range == 64) + pci_write_config(dev, reg + 4, start >> 32, 4); return (barlen); } |