From: FUJITA Tomonori Date: Sat, 12 Jan 2008 17:20:18 +0000 (+0900) Subject: [SCSI] libsas: fix sense_buffer overrun X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=cc75e8ab6f262a3ea60e8d8268f48da5365f2823;p=openwrt%2Fstaging%2Fblogic.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 b784089b18d0..828fed1114ee 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: