All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roel Kluin <roel.kluin@gmail.com>
To: anil_ravindranath@pmc-sierra.com, linux-scsi@vger.kernel.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: [PATCH] pmcraid: redundant check in pmcraid_check_ioctl_buffer()?
Date: Wed, 21 Oct 2009 16:41:14 +0200	[thread overview]
Message-ID: <4ADF1D8A.1030906@gmail.com> (raw)

struct pmcraid_ioctl_header member buffer_length is unsigned, so
this check appears redundant.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Or should we replace it by a check like
if (hdr->buffer_length > MAX) ... ?

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index f7c70e2..e448776 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3731,12 +3731,6 @@ static int pmcraid_check_ioctl_buffer(
 		return -EINVAL;
 	}
 
-	/* buffer length can't be negetive */
-	if (hdr->buffer_length < 0) {
-		pmcraid_err("ioctl: invalid buffer length specified\n");
-		return -EINVAL;
-	}
-
 	/* check for appropriate buffer access */
 	if ((_IOC_DIR(cmd) & _IOC_READ) == _IOC_READ)
 		access = VERIFY_WRITE;

             reply	other threads:[~2009-10-21 14:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-21 14:41 Roel Kluin [this message]
2009-10-22 20:37 ` [PATCH] pmcraid: redundant check in pmcraid_check_ioctl_buffer()? Anil Ravindranath

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=4ADF1D8A.1030906@gmail.com \
    --to=roel.kluin@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=anil_ravindranath@pmc-sierra.com \
    --cc=linux-scsi@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.