aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/md
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2004-11-13 05:00:12 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2004-11-13 05:00:12 +0000
commit8b6fc67a4955f6c743c703736e6a82713f2d9774 (patch)
treed5bf17b02d7a47f3c856c2f2b4c6e29a5c1cd629 /sys/dev/md
parentde3abdfaf43424d8a9242df6051feab0d75de00f (diff)
downloadsrc-8b6fc67a4955f6c743c703736e6a82713f2d9774.tar.gz
src-8b6fc67a4955f6c743c703736e6a82713f2d9774.zip
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'.
Notes
Notes: svn path=/head/; revision=137640
Diffstat (limited to 'sys/dev/md')
-rw-r--r--sys/dev/md/md.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c
index 0dc968667565..775728f2ed0f 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));