Re: [PATCH] [media] gp8psk: fix gp8psk_usb_in_op() logic

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

 



On Mon, Nov 7, 2016 at 4:52 AM, Mauro Carvalho Chehab
<mchehab@xxxxxxxxxxxxxxxx> wrote:
> Changeset bc29131ecb10 ("[media] gp8psk: don't do DMA on stack")
> fixed the usage of DMA on stack, but the memcpy was wrong
> for gp8psk_usb_in_op(). Fix it.
>
> Suggested-by: Johannes Stezenbach <js@xxxxxxxxxxx>
> Fixes: bc29131ecb10 ("[media] gp8psk: don't do DMA on stack")
> Signed-off-by: Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxxxxx>

Fix confirmed using 2 different Skywalker models with HD mpeg4, SD mpeg2.

Tested-by: <user.vdr@xxxxxxxxx>

> ---
>  drivers/media/usb/dvb-usb/gp8psk.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/usb/dvb-usb/gp8psk.c b/drivers/media/usb/dvb-usb/gp8psk.c
> index adfd76491451..2829e3082d15 100644
> --- a/drivers/media/usb/dvb-usb/gp8psk.c
> +++ b/drivers/media/usb/dvb-usb/gp8psk.c
> @@ -67,7 +67,6 @@ int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8
>                 return ret;
>
>         while (ret >= 0 && ret != blen && try < 3) {
> -               memcpy(st->data, b, blen);
>                 ret = usb_control_msg(d->udev,
>                         usb_rcvctrlpipe(d->udev,0),
>                         req,
> @@ -81,8 +80,10 @@ int gp8psk_usb_in_op(struct dvb_usb_device *d, u8 req, u16 value, u16 index, u8
>         if (ret < 0 || ret != blen) {
>                 warn("usb in %d operation failed.", req);
>                 ret = -EIO;
> -       } else
> +       } else {
>                 ret = 0;
> +               memcpy(b, st->data, blen);
> +       }
>
>         deb_xfer("in: req. %x, val: %x, ind: %x, buffer: ",req,value,index);
>         debug_dump(b,blen,deb_xfer);
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux