Re: [PATCH 15/16] block: split scsi_request out of struct request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux