diff options
author | marcel <marcel@FreeBSD.org> | 2004-11-13 05:00:12 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2004-11-13 05:00:12 +0000 |
commit | 69615940956025a5e3885ba5f9b40982cfa43c7e (patch) | |
tree | d5bf17b02d7a47f3c856c2f2b4c6e29a5c1cd629 /sys/dev | |
parent | 619b5d9b025146f6bbf2334dcdfa9e724751d89e (diff) | |
download | FreeBSD-src-69615940956025a5e3885ba5f9b40982cfa43c7e.zip FreeBSD-src-69615940956025a5e3885ba5f9b40982cfa43c7e.tar.gz |
Fix the MDIOCDETACH ioctl() for md(4). Now that the md_file field in
the mdio structure is an array and not a pointer, we cannot test for
it to be NULL. It never is. Instead, test for md_file[0] to be '\0'.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/md/md.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index 0dc9686..775728f 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -1087,7 +1087,7 @@ mdctlioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flags, struct thread case MDIOCDETACH: if (mdio->md_version != MDIOVERSION) return (EINVAL); - if (mdio->md_file != NULL || mdio->md_mediasize != 0 || + if (mdio->md_file[0] != '\0' || mdio->md_mediasize != 0 || mdio->md_options != 0) return (EINVAL); return (mddetach(mdio->md_unit, td)); |