diff options
author | phk <phk@FreeBSD.org> | 2005-03-18 06:57:58 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-03-18 06:57:58 +0000 |
commit | aaa532d7788681034547ebcf7dc4ccf59b455ec7 (patch) | |
tree | 2857f473f360f1d9f119414b95e5dd993f22b42e /sys/geom/geom_dev.c | |
parent | ae412c6cc0589a0581f167a1a1013bc366954a20 (diff) | |
download | FreeBSD-src-aaa532d7788681034547ebcf7dc4ccf59b455ec7.zip FreeBSD-src-aaa532d7788681034547ebcf7dc4ccf59b455ec7.tar.gz |
Avoid null pointer dereference.
Diffstat (limited to 'sys/geom/geom_dev.c')
-rw-r--r-- | sys/geom/geom_dev.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c index 4e556ec..bbb4b3a 100644 --- a/sys/geom/geom_dev.c +++ b/sys/geom/geom_dev.c @@ -113,9 +113,8 @@ g_dev_getprovider(struct cdev *dev) if (dev == NULL) return (NULL); if (dev->si_devsw != &g_dev_cdevsw) - cp = NULL; - else - cp = dev->si_drv2; + return (NULL); + cp = dev->si_drv2; return (cp->provider); } |