Author: scottl
Date: Mon Dec 31 23:30:31 2018
New Revision: 342660
URL: https://svnweb.freebsd.org/changeset/base/342660

Log:
  Port over the SCSI sense handling fix from mpr(4) in r342528, and fix
  whitespace to match.

Modified:
  head/sys/dev/mps/mps_user.c

Modified: head/sys/dev/mps/mps_user.c
==============================================================================
--- head/sys/dev/mps/mps_user.c Mon Dec 31 23:27:56 2018        (r342659)
+++ head/sys/dev/mps/mps_user.c Mon Dec 31 23:30:31 2018        (r342660)
@@ -1043,10 +1043,12 @@ mps_user_pass_thru(struct mps_softc *sc, mps_pass_thru
                        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);
                        }
                }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to