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
This commit is contained in:
Bruce Evans 2000-03-09 12:40:41 +00:00
parent 40a121a27c
commit a4fcac54a1

View File

@ -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 (?) */