Skip to content

Commit f1889c9

Browse files
ISCAS-VulabWim Van Sebroeck
authored andcommitted
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: Xu Wang <[email protected]> Reviewed-by: Guenter Roeck <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Wim Van Sebroeck <[email protected]>
1 parent 2ab77a3 commit f1889c9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/watchdog/pcwd_usb.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,8 @@ static struct notifier_block usb_pcwd_notifier = {
585585
static inline void usb_pcwd_delete(struct usb_pcwd_private *usb_pcwd)
586586
{
587587
usb_free_urb(usb_pcwd->intr_urb);
588-
if (usb_pcwd->intr_buffer != NULL)
589-
usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
590-
usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
588+
usb_free_coherent(usb_pcwd->udev, usb_pcwd->intr_size,
589+
usb_pcwd->intr_buffer, usb_pcwd->intr_dma);
591590
kfree(usb_pcwd);
592591
}
593592

0 commit comments

Comments
 (0)