From: FUJITA Tomonori Date: Sun, 27 Jan 2008 01:22:26 +0000 (+0900) Subject: [SCSI] hptiop: fix sense_buffer access bug X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c372f4a82fa3d98e2641664ed79e48dddef48097;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [SCSI] hptiop: fix sense_buffer access bug &cmnd->sense_buffer now zeroes the wrong thing. Signed-off-by: FUJITA Tomonori Signed-off-by: James Bottomley --- diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index e7b2f3575ce9..890f44fa0e1a 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c @@ -573,7 +573,7 @@ static void hptiop_finish_scsi_req(struct hptiop_hba *hba, u32 tag, scsi_set_resid(scp, scsi_bufflen(scp) - le32_to_cpu(req->dataxfer_length)); scp->result = SAM_STAT_CHECK_CONDITION; - memcpy(&scp->sense_buffer, &req->sg_list, + memcpy(scp->sense_buffer, &req->sg_list, min_t(size_t, SCSI_SENSE_BUFFERSIZE, le32_to_cpu(req->dataxfer_length))); break;