summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorFUJITA Tomonori <tomof@acm.org>2008-01-13 02:20:18 +0900
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-01-23 11:29:26 -0600
commitcc75e8ab6f262a3ea60e8d8268f48da5365f2823 (patch)
tree84be7a959b51f7f3349daead61dba5814155ab24 /drivers/scsi
parent3bc8070fb75b33151791fb54ca36ae5abcc8b8df (diff)
downloadlinux-cc75e8ab6f262a3ea60e8d8268f48da5365f2823.tar.gz
linux-cc75e8ab6f262a3ea60e8d8268f48da5365f2823.tar.bz2
linux-cc75e8ab6f262a3ea60e8d8268f48da5365f2823.zip
[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/libsas/sas_scsi_host.c2
1 files changed, 1 insertions, 1 deletions
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: