]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
usb: host: remove unnecessary condition check
authorChengguang Xu <cgxu519@gmx.com>
Fri, 2 Nov 2018 14:14:27 +0000 (22:14 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Nov 2018 12:22:06 +0000 (13:22 +0100)
dma_pool_destroy() can handle NULL pointer correctly, so there is
no need to check NULL pointer before calling dma_pool_destroy().

Signed-off-by: Chengguang Xu <cgxu519@gmx.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-mem.c

index b3da3f12e5b1ba63a7898712bde72292eda5c265..3965ac0341eb14bb35eb69ac0d9f708603b2bcbb 100644 (file)
@@ -57,14 +57,10 @@ static int ohci_mem_init (struct ohci_hcd *ohci)
 
 static void ohci_mem_cleanup (struct ohci_hcd *ohci)
 {
-       if (ohci->td_cache) {
-               dma_pool_destroy (ohci->td_cache);
-               ohci->td_cache = NULL;
-       }
-       if (ohci->ed_cache) {
-               dma_pool_destroy (ohci->ed_cache);
-               ohci->ed_cache = NULL;
-       }
+       dma_pool_destroy(ohci->td_cache);
+       ohci->td_cache = NULL;
+       dma_pool_destroy(ohci->ed_cache);
+       ohci->ed_cache = NULL;
 }
 
 /*-------------------------------------------------------------------------*/