public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Young <sean@mess.org>
To: Oliver Neukum <oneukum@suse.com>
Cc: linux-media@vger.kernel.org, mchehab@kernel.org
Subject: Re: [PATCH 1/4] igorplugusb: respect DMA coherency
Date: Fri, 13 May 2022 17:20:21 +0100	[thread overview]
Message-ID: <Yn6FRdZyL4jzd0Qa@gofer.mess.org> (raw)
In-Reply-To: <20220512123849.25903-1-oneukum@suse.com>

On Thu, May 12, 2022 at 02:38:46PM +0200, Oliver Neukum wrote:
> The coherency rules mean that you cannot embed
> a buffer inside a descriptor. kmalloc() separately.

I've merged this series to my tree. Thanks!

Sean
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> ---
>  drivers/media/rc/igorplugusb.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/rc/igorplugusb.c b/drivers/media/rc/igorplugusb.c
> index b40dbf500186..b46362da8623 100644
> --- a/drivers/media/rc/igorplugusb.c
> +++ b/drivers/media/rc/igorplugusb.c
> @@ -38,7 +38,7 @@ struct igorplugusb {
>  
>  	struct timer_list timer;
>  
> -	uint8_t buf_in[MAX_PACKET];
> +	u8 *buf_in;
>  
>  	char phys[64];
>  };
> @@ -177,6 +177,9 @@ static int igorplugusb_probe(struct usb_interface *intf,
>  	if (!ir->urb)
>  		goto fail;
>  
> +	ir->buf_in = kmalloc(MAX_PACKET, GFP_KERNEL);
> +	if (!ir->buf_in)
> +		goto fail;
>  	usb_fill_control_urb(ir->urb, udev,
>  		usb_rcvctrlpipe(udev, 0), (uint8_t *)&ir->request,
>  		ir->buf_in, sizeof(ir->buf_in), igorplugusb_callback, ir);
> @@ -223,6 +226,7 @@ static int igorplugusb_probe(struct usb_interface *intf,
>  	rc_free_device(ir->rc);
>  	usb_free_urb(ir->urb);
>  	del_timer(&ir->timer);
> +	kfree(ir->buf_in);
>  
>  	return ret;
>  }
> @@ -236,6 +240,7 @@ static void igorplugusb_disconnect(struct usb_interface *intf)
>  	usb_set_intfdata(intf, NULL);
>  	usb_kill_urb(ir->urb);
>  	usb_free_urb(ir->urb);
> +	kfree(ir->buf_in);
>  }
>  
>  static const struct usb_device_id igorplugusb_table[] = {
> -- 
> 2.35.3

      parent reply	other threads:[~2022-05-13 16:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-12 12:38 [PATCH 1/4] igorplugusb: respect DMA coherency Oliver Neukum
2022-05-12 12:38 ` [PATCH 2/4] igorplugusb: prevent use after free in probe error Oliver Neukum
2022-05-12 12:38 ` [PATCH 3/4] igorplugusb: break cyclical race on disconnect Oliver Neukum
2022-05-12 12:38 ` [PATCH 4/4] igorplugusb: remove superfluous usb_unlink_urb() Oliver Neukum
2022-05-13 16:20 ` Sean Young [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yn6FRdZyL4jzd0Qa@gofer.mess.org \
    --to=sean@mess.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=oneukum@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox