I agree this check is not necessary. Signed-off-by: Anil Ravindranath <anil_ravindranath@xxxxxxxxxxxxxx> On Wed, 21 Oct 2009, Roel Kluin wrote: > struct pmcraid_ioctl_header member buffer_length is unsigned, so > this check appears redundant. > > Signed-off-by: Roel Kluin <roel.kluin@xxxxxxxxx> > --- > 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; > -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html