summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-01-14 21:31:00 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-01-14 21:31:00 +0000
commitd320fdbca73f862c88347208d0be7681e7f003d8 (patch)
tree148f0031741511b56db30ea292d5978a76543c2a
parent706d96e8c62c01f48ade8fdc356514633980b915 (diff)
Notes
-rw-r--r--sys/geom/geom_dev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/geom/geom_dev.c b/sys/geom/geom_dev.c
index 188fc290db6b..fd2b44dd3d35 100644
--- a/sys/geom/geom_dev.c
+++ b/sys/geom/geom_dev.c
@@ -260,6 +260,7 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
error = 0;
DROP_GIANT();
+ gio = NULL;
i = IOCPARM_LEN(cmd);
switch (cmd) {
case DIOCGSECTORSIZE:
@@ -322,10 +323,8 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
KASSERT(gio->func != NULL, ("NULL function but EDIRIOCTL"));
error = (gio->func)(gio->dev, cmd, data, fflag, td);
}
- if (gio != NULL)
- g_free(gio);
g_waitidle();
- if (error == ENOIOCTL) {
+ if (gio != NULL && (error == EOPNOTSUPP || error == ENOIOCTL)) {
if (g_debugflags & G_T_TOPOLOGY) {
i = IOCGROUP(cmd);
printf("IOCTL(0x%lx) \"%s\"", cmd, gp->name);
@@ -342,6 +341,8 @@ g_dev_ioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct thread *td)
}
error = ENOTTY;
}
+ if (gio != NULL)
+ g_free(gio);
return (error);
}