All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sesterhenn / snakebyte <snakebyte@gmx.de>
To: kernel-janitors@vger.kernel.org
Subject: [KJ] [Patch] Check unsigned < 0 in media/video/mxb.c
Date: Fri, 16 Dec 2005 13:38:05 +0000	[thread overview]
Message-ID: <1134740285.9464.1.camel@alice> (raw)
In-Reply-To: <1134733947.8536.2.camel@alice>

[-- Attachment #1: Type: text/plain, Size: 935 bytes --]

hi,

index is unsigned and seems to be used only as an
array index, so it should be safe to remove the
two comparisons.

Signed-of-by: Eric Sesterhenn <snakebyte@gmx.de>


--- linux-2.6.15-rc5-git2/drivers/media/video/mxb.c.orig	2005-12-16 14:34:10.000000000 +0100
+++ linux-2.6.15-rc5-git2/drivers/media/video/mxb.c	2005-12-16 14:34:37.000000000 +0100
@@ -521,7 +521,7 @@ static int mxb_ioctl(struct saa7146_fh *
 		struct v4l2_input *i = arg;
 		
 		DEB_EE(("VIDIOC_ENUMINPUT %d.\n",i->index));
-		if( i->index < 0 || i->index >= MXB_INPUTS) {
+		if( i->index >= MXB_INPUTS) {
 			return -EINVAL;
 		}
 		memcpy(i, &mxb_inputs[i->index], sizeof(struct v4l2_input));
@@ -889,7 +889,7 @@ static int mxb_ioctl(struct saa7146_fh *
 	{
 		struct v4l2_audio *a = arg;
 
-		if( a->index < 0 || a->index > MXB_INPUTS ) {
+		if( a->index > MXB_INPUTS ) {
 	 		DEB_D(("VIDIOC_G_AUDIO %d out of range.\n",a->index));
 			return -EINVAL;
 		}



[-- Attachment #2: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

  parent reply	other threads:[~2005-12-16 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-16 11:52 [KJ] [Patch] Check unsigned < 0 in media/video/hexium_gemini.c Eric Sesterhenn / snakebyte
2005-12-16 11:54 ` [KJ] [Patch] check unsigned < 0 in media/video/hexium_orion.c Eric Sesterhenn / snakebyte
2005-12-16 13:38 ` Eric Sesterhenn / snakebyte [this message]
2005-12-16 14:25 ` [KJ] [Patch] Check unsigned < 0 in media/video/hexium_gemini.c Tobias Klauser
2005-12-18 16:45 ` [KJ] [Patch] Check unsigned < 0 in media/video/mxb.c Ricardo Nabinger Sanchez
2005-12-18 21:12 ` Eric Sesterhenn / snakebyte

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=1134740285.9464.1.camel@alice \
    --to=snakebyte@gmx.de \
    --cc=kernel-janitors@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.