All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lee Brown <leejr@linuxsoftwareconsultants.com>
To: linux-kernel@vger.kernel.org
Subject: [patch]  Does this correct  a bug in ibmcam.c?
Date: Mon, 12 Mar 2001 03:52:02 -0500	[thread overview]
Message-ID: <01031203541300.02643@darkstar> (raw)

I had problems with copy_from_user.

Please CC me as I am not on this list.
__________________________________


--- ibmcam.c.orig	Fri Feb  9 14:30:23 2001
+++ ibmcam.c	Mon Mar 12 02:58:57 2001
@@ -2527,16 +2527,17 @@
 		}
 		case VIDIOCSCHAN:
 		{
-			int v;
+			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;
 		}
 		case VIDIOCGPICT:



-- 
Lee Brown Jr.

             reply	other threads:[~2001-03-12 18:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-12  8:52 Lee Brown [this message]
2001-03-12 19:24 ` [patch] Does this correct a bug in ibmcam.c? Alan Cox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=01031203541300.02643@darkstar \
    --to=leejr@linuxsoftwareconsultants.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.