summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2001-10-28 09:39:28 +0000
committerphk <phk@FreeBSD.org>2001-10-28 09:39:28 +0000
commit8c752a11c0bed8bb94fd04769efb2cec3237e7d8 (patch)
tree28d0eb4336690e72a7c37fcb1d4d85951c43ff0d /sys/kern/subr_disk.c
parentf757fda60d8e586e6ba39ba525f615b8cb3fe0ce (diff)
downloadFreeBSD-src-8c752a11c0bed8bb94fd04769efb2cec3237e7d8.zip
FreeBSD-src-8c752a11c0bed8bb94fd04769efb2cec3237e7d8.tar.gz
Fix a problem in the disk related hack where device nodes for a physically
non-existent disk in a legacy /dev on a DEVFS system would panic the system if stat(2)'ed. Do not whine about anonymous device nodes not having a si_devsw, they're not supposed to.
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 8e637ff..ce5f6e0 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -48,6 +48,8 @@ disk_dev_synth(dev_t dev)
p = RAW_PART;
s = WHOLE_DISK_SLICE;
pdev = makedev(dp->d_devsw->d_maj, dkmakeminor(u, s, p));
+ if (pdev->si_devsw == NULL)
+ return; /* Probably a unit we don't have */
s = dkslice(dev);
p = dkpart(dev);
if (s == WHOLE_DISK_SLICE && p == RAW_PART) {
OpenPOWER on IntegriCloud