linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Xu Wang <vulab@iscas.ac.cn>
Cc: wim@linux-watchdog.org, linux-watchdog@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] watchdog: pcwd_usb: remove needless check before usb_free_coherent()
Date: Sun, 19 Jul 2020 07:01:58 -0700	[thread overview]
Message-ID: <20200719140158.GA37652@roeck-us.net> (raw)
In-Reply-To: <20200713055348.21620-1-vulab@iscas.ac.cn>

On Mon, Jul 13, 2020 at 05:53:48AM +0000, Xu Wang wrote:
> usb_free_coherent() is safe with NULL usb_pcwd->intr_buffer and 
> this check is not required.
> 
> Signed-off-by: Xu Wang <vulab@iscas.ac.cn>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/pcwd_usb.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/watchdog/pcwd_usb.c b/drivers/watchdog/pcwd_usb.c
> index 2f44af1831d0..6726301ac02e 100644
> --- a/drivers/watchdog/pcwd_usb.c
> +++ b/drivers/watchdog/pcwd_usb.c
> @@ -585,9 +585,8 @@ static struct notifier_block usb_pcwd_notifier = {
>  static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
>  {
>  	usb_free_urb(usb_pcwd->intr_urb);
> -	if (usb_pcwd->intr_buffer != NULL)
> -		usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
> -				  usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
> +	usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
> +			  usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
>  	kfree(usb_pcwd);
>  }
>  

      reply	other threads:[~2020-07-19 14:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-13  5:53 [PATCH] watchdog: pcwd_usb: remove needless check before usb_free_coherent() Xu Wang
2020-07-19 14:01 ` Guenter Roeck [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=20200719140158.GA37652@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=vulab@iscas.ac.cn \
    --cc=wim@linux-watchdog.org \
    /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).