[SCSI] libsas: fix sense_buffer overrun

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
This commit is contained in:
FUJITA Tomonori 2008-01-13 02:20:18 +09:00 committed by James Bottomley
parent 3bc8070fb7
commit cc75e8ab6f

View File

@ -108,7 +108,7 @@ static void sas_scsi_task_done(struct sas_task *task)
break;
case SAM_CHECK_COND:
memcpy(sc->sense_buffer, ts->buf,
max(SCSI_SENSE_BUFFERSIZE, ts->buf_valid_size));
min(SCSI_SENSE_BUFFERSIZE, ts->buf_valid_size));
stat = SAM_CHECK_COND;
break;
default: