linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Chen Ni <vulab@iscas.ac.cn>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: misc: remove needless check before usb_free_coherent()
Date: Mon, 6 Jul 2020 18:44:14 -0700	[thread overview]
Message-ID: <20200707014414.GD3273837@dtor-ws> (raw)
In-Reply-To: <20200630063616.8060-1-vulab@iscas.ac.cn>

Hi,

On Tue, Jun 30, 2020 at 06:36:16AM +0000, Chen Ni wrote:
> From: Xu Wang <vulab@iscas.ac.cn>
> 
> usb_free_coherent() is safe with NULL addr and this check is
> not required.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Even if you are passing on a patch created by someone else you still
need to add your "signed-off-by" to it. Please resubmit with both your
and Xu Wang's sign-offs.

> ---
>  drivers/input/misc/cm109.c | 8 ++------
>  1 file changed, 2 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
> index c09b9628ad34..e413801f0491 100644
> --- a/drivers/input/misc/cm109.c
> +++ b/drivers/input/misc/cm109.c
> @@ -663,12 +663,8 @@ static const struct usb_device_id cm109_usb_table[] = {
>  static void cm109_usb_cleanup(struct cm109_dev *dev)
>  {
>  	kfree(dev->ctl_req);
> -	if (dev->ctl_data)
> -		usb_free_coherent(dev->udev, USB_PKT_LEN,
> -				  dev->ctl_data, dev->ctl_dma);
> -	if (dev->irq_data)
> -		usb_free_coherent(dev->udev, USB_PKT_LEN,
> -				  dev->irq_data, dev->irq_dma);
> +	usb_free_coherent(dev->udev, USB_PKT_LEN, dev->ctl_data, dev->ctl_dma);
> +	usb_free_coherent(dev->udev, USB_PKT_LEN, dev->irq_data, dev->irq_dma);
>  
>  	usb_free_urb(dev->urb_irq);	/* parameter validation in core/urb */
>  	usb_free_urb(dev->urb_ctl);	/* parameter validation in core/urb */
> -- 
> 2.17.1
> 

Thanks.

-- 
Dmitry

  reply	other threads:[~2020-07-07  1:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30  6:36 [PATCH] input: misc: remove needless check before usb_free_coherent() Chen Ni
2020-07-07  1:44 ` Dmitry Torokhov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-07  3:09 Xu Wang

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=20200707014414.GD3273837@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    /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;
as well as URLs for NNTP newsgroup(s).