Re: [patch] Does this correct a bug in ibmcam.c?

Alan Cox (alan@lxorguk.ukuu.org.uk)
Mon, 12 Mar 2001 19:24:27 +0000 (GMT)


> + int chan;
>
> - if (copy_from_user(&v, arg, sizeof(v)))
> - return -EFAULT;
> - if ((v < 0) || (v >= 3)) /* 3 grades of lighting conditions */
> - return -EINVAL;
> - if (v != ibmcam->vchan.channel) {
> - ibmcam->vchan.channel = v;
> + chan = (int)arg;
> +
> + if ((chan < 0) || (chan >= 3)) /* 3 grades of lighting conditions */
> + return -EINVAL;
> +
> + if (chan != ibmcam->vchan.channel) {
> + ibmcam->vchan.channel = chan;
> usb_ibmcam_change_lighting_conditions(ibmcam);
> - }
> + }
> return 0;
> }

This change is wrong. I think you are calling the ioctl wrongly

-
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/