Subject: bogon in linux compat code
To: None <tech-kern@netbsd.org>
From: Simon Burge <simonb@wasabisystems.com>
List: tech-kern
Date: 10/22/2002 12:02:34
Currently there's the use of an uninitialised variable in part of the
linux compat code.  The "va" variable is used before it is initalised.
The following seems right based on what I think the code is doing, but
I'm not 100% sure.  Can anyone double-check this?

Simon.
--
Simon Burge                                   <simonb@wasabisystems.com>
NetBSD Development, Support and Service:   http://www.wasabisystems.com/


Index: compat/linux/common/linux_ioctl.c
===================================================================
RCS file: /cvsroot/syssrc/sys/compat/linux/common/linux_ioctl.c,v
retrieving revision 1.29
diff -d -p -u -r1.29 linux_ioctl.c
--- compat/linux/common/linux_ioctl.c	2002/09/06 13:22:52	1.29
+++ compat/linux/common/linux_ioctl.c	2002/10/22 02:00:28
@@ -114,17 +114,15 @@ linux_sys_ioctl(p, v, retval)
 		struct vnode *vp;
 		struct vattr va;
 		extern const struct cdevsw sequencer_cdevsw;
-		const struct cdevsw *cdev;
 
 		fdp = p->p_fd;
-		cdev = cdevsw_lookup(va.va_rdev);
 		if ((fp = fd_getfile(fdp, SCARG(uap, fd))) == NULL)
 			return EBADF;
 		if (fp->f_type == DTYPE_VNODE &&
 		    (vp = (struct vnode *)fp->f_data) != NULL &&
 		    vp->v_type == VCHR &&
 		    VOP_GETATTR(vp, &va, p->p_ucred, p) == 0 &&
-		    cdev == &sequencer_cdevsw)
+		    cdevsw_lookup(va.va_rdev) == &sequencer_cdevsw)
 			return oss_ioctl_sequencer(p, (void*)LINUX_TO_OSS(uap),
 						   retval);
 		else