![]() | |||||||||||||
Messages in this thread Patch in this message |
> Stare at this as I might, I dont understand why does it make sence.
> So if filp->f_op is NULL, you are then checking filp->f_op->ioctl?
> Looks like an oops to me.
I doesn't make sense, but fortunately files with NULL filp->f_op don't
happen in practice (need to research whether it can't happen in theory
either so we could lose lots of checks)
> > What should be there:> > > + if (!filp->f_op) {> > + goto do_ioctl;> > + } else if (filp->f_op->compat_ioctl) {> > + error = filp->f_op->compat_ioctl(filp, cmd, arg);
> > + goto out_fput;
not correct either, see the incremental patch below.
> Look, was this patch even tested?
Yes.
--- linux-2.6.10-mm2.orig/fs/compat.c 2005-01-06 11:40:18.831900000 +0100
+++ linux-2.6.10-mm2/fs/compat.c 2005-01-06 15:50:23.802874672 +0100
@@ -436,10 +436,10 @@
if (!filp)
goto out;
- if (!filp->f_op) {
- if (!filp->f_op->ioctl)
- goto do_ioctl;
- } else if (filp->f_op->compat_ioctl) {
+ if (!filp->f_op || !filp->f_op->ioctl)
+ goto do_ioctl;
+
+ if (filp->f_op || filp->f_op->compat_ioctl) {
error = filp->f_op->compat_ioctl(filp, cmd, arg);
goto out_fput;
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
| ||||||||||||
| Last update: 2005-03-22 14:09 [from the cache] ©2003-2008 | |||||||||||||