From 808a5e94da23bb359d3753f5e17be366abc4831a Mon Sep 17 00:00:00 2001 From: Scott Long Date: Mon, 31 Dec 2018 23:30:31 +0000 Subject: [PATCH] Port over the SCSI sense handling fix from mpr(4) in r342528, and fix whitespace to match. --- sys/dev/mps/mps_user.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/mps/mps_user.c b/sys/dev/mps/mps_user.c index c64fad45927..6a37c52970f 100644 --- a/sys/dev/mps/mps_user.c +++ b/sys/dev/mps/mps_user.c @@ -1043,10 +1043,12 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru_t *data) if (((MPI2_SCSI_IO_REPLY *)rpl)->SCSIState & MPI2_SCSI_STATE_AUTOSENSE_VALID) { sense_len = - MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)->SenseCount)), - sizeof(struct scsi_sense_data)); + MIN((le32toh(((MPI2_SCSI_IO_REPLY *)rpl)-> + SenseCount)), sizeof(struct + scsi_sense_data)); mps_unlock(sc); - copyout(cm->cm_sense, cm->cm_req + 64, sense_len); + copyout(cm->cm_sense, (PTRIN(data->PtrReply + + sizeof(MPI2_SCSI_IO_REPLY))), sense_len); mps_lock(sc); } }