diff options
author | bde <bde@FreeBSD.org> | 2000-03-09 12:40:41 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2000-03-09 12:40:41 +0000 |
commit | 2eef6765bdeaaadb9ae11f47beb902eb00413f47 (patch) | |
tree | 8c31edaf8cf8e94a3d4896f34442ba40f15e64b5 /sys/kern/subr_disk.c | |
parent | 4988cee646c535a31e7d493bb20a50ff8d7e8c0e (diff) | |
download | FreeBSD-src-2eef6765bdeaaadb9ae11f47beb902eb00413f47.zip FreeBSD-src-2eef6765bdeaaadb9ae11f47beb902eb00413f47.tar.gz |
Fixed a null pointer panic for dumpon(8) on a nonexistent device whose
driver uses the new disk layer.
Reviewed by: phk
Approved by: jkh
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r-- | sys/kern/subr_disk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c index cf1b3cc..23ec003 100644 --- a/sys/kern/subr_disk.c +++ b/sys/kern/subr_disk.c @@ -229,6 +229,8 @@ diskpsize(dev_t dev) if (!dp) { pdev = dkmodpart(dkmodslice(dev, WHOLE_DISK_SLICE), RAW_PART); dp = pdev->si_disk; + if (!dp) + return (-1); dev->si_drv1 = pdev->si_drv1; dev->si_drv2 = pdev->si_drv2; /* XXX: don't set bp->b_dev->si_disk (?) */ |