Commit f1889c90 authored by Xu Wang's avatar Xu Wang Committed by Wim Van Sebroeck

watchdog: pcwd_usb: remove needless check before usb_free_coherent()

usb_free_coherent() is safe with NULL usb_pcwd->intr_buffer and
this check is not required.
Signed-off-by: default avatarXu Wang <vulab@iscas.ac.cn>
Reviewed-by: default avatarGuenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20200713055348.21620-1-vulab@iscas.ac.cnSigned-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarWim Van Sebroeck <wim@linux-watchdog.org>
parent 2ab77a34
...@@ -585,7 +585,6 @@ static struct notifier_block usb_pcwd_notifier = { ...@@ -585,7 +585,6 @@ static struct notifier_block usb_pcwd_notifier = {
static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd) static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
{ {
usb_free_urb(usb_pcwd->intr_urb); usb_free_urb(usb_pcwd->intr_urb);
if (usb_pcwd->intr_buffer != NULL)
usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size, usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
usb_pcwd->intr_buffer, usb_pcwd->intr_dma); usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
kfree(usb_pcwd); kfree(usb_pcwd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment