From: FUJITA Tomonori Date: Sat, 12 Jan 2008 17:20:18 +0000 (+0900) Subject: [SCSI] libsas: fix sense_buffer overrun X-Git-Tag: v2.6.25-rc1~1230^2~44 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=cc75e8ab6f262a3ea60e8d8268f48da5365f2823;p=linux-2.6-omap-h63xx.git [SCSI] libsas: fix sense_buffer overrun Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index b784089b18d..828fed1114e 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -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: