On Mon, 2017-01-23 at 16:29 +0100, Christoph Hellwig wrote: > @@ -251,11 +251,13 @@ static int __scsi_execute(struct scsi_device *sdev, const unsigned char *cmd, > * is invalid. Prevent the garbage from being misinterpreted > * and prevent security leaks by zeroing out the excess data. > */ > - if (unlikely(req->resid_len > 0 && req->resid_len <= bufflen)) > - memset(buffer + (bufflen - req->resid_len), 0, req->resid_len); > + if (unlikely(rq->resid_len > 0 && rq->resid_len <= bufflen)) > + memset(buffer + (bufflen - rq->resid_len), 0, rq->resid_len); > > if (resid) > - *resid = req->resid_len; > + *resid = rq->resid_len; > + if (rq->sense_len) > + memcpy(sense, rq->sense, SCSI_SENSE_BUFFERSIZE); > ret = req->errors; > out: > blk_put_request(req); Hello Christoph, Do we perhaps need a check before the above memcpy() call whether or not sense == NULL? Thanks, Bart. -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel