All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Joe Eykholt <jeykholt@cisco.com>
Cc: "James E.J. Bottomley" <James.Bottomley@suse.de>,
	linux-scsi@vger.kernel.org
Subject: Re: [patch] off by one in FlashPoint.c
Date: Mon, 28 Dec 2009 20:03:48 +0200	[thread overview]
Message-ID: <20091228180348.GH17645@bicker> (raw)
In-Reply-To: <4B38E77F.2070201@cisco.com>

On Mon, Dec 28, 2009 at 12:14:39PM -0500, Joe Eykholt wrote:
>
>
> Dan Carpenter wrote:
>> The check should be >= instead of > or we could go past the end of the
>> array.
>
> What about the LUN check?   I'm not sure either way, but usually MAX LUN
> is the max number of LUNs, not the max LU number, although that's been
> in flux lately.
>

No no.  You're clearly correct.  That matches how MAX_LUN is used throughout 
the file.

Will send an updated patch.

regards,
dan carpenter

>>
>> Signed-off-by: Dan Carpenter <error27@gmail.com>
>>
>> --- orig/drivers/scsi/FlashPoint.c	2009-12-27 11:35:58.000000000 +0200
>> +++ devel/drivers/scsi/FlashPoint.c	2009-12-27 11:36:19.000000000 +0200
>> @@ -3924,7 +3924,7 @@
>>  {
>>  	struct sccb_mgr_tar_info *currTar_Info;
>>  -	if ((p_sccb->TargID > MAX_SCSI_TAR) || (p_sccb->Lun > MAX_LUN)) {
>> +	if ((p_sccb->TargID >= MAX_SCSI_TAR) || (p_sccb->Lun > MAX_LUN)) {
>>  		return;
>>  	}
>>  	currTar_Info = &FPT_sccbMgrTbl[p_card][p_sccb->TargID];
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2009-12-28 18:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-27 13:14 [patch] off by one in FlashPoint.c Dan Carpenter
2009-12-28 17:14 ` Joe Eykholt
2009-12-28 18:03   ` Dan Carpenter [this message]
2009-12-28 18:08   ` [patch] off by one in FlashPoint.c (v2) Dan Carpenter

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=20091228180348.GH17645@bicker \
    --to=error27@gmail.com \
    --cc=James.Bottomley@suse.de \
    --cc=jeykholt@cisco.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.