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: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc75e8ab6f262a3ea60e8d8268f48da5365f2823;p=linux-2.6 [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 b784089b18..828fed1114 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: