Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: host: remove unnecessary condition check

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>

authored by

Chengguang Xu and committed by
Greg Kroah-Hartman
1d3e773a 157c0f2f

+4 -8
+4 -8
drivers/usb/host/ohci-mem.c
··· 57 57 58 58 static void ohci_mem_cleanup (struct ohci_hcd *ohci) 59 59 { 60 - if (ohci->td_cache) { 61 - dma_pool_destroy (ohci->td_cache); 62 - ohci->td_cache = NULL; 63 - } 64 - if (ohci->ed_cache) { 65 - dma_pool_destroy (ohci->ed_cache); 66 - ohci->ed_cache = NULL; 67 - } 60 + dma_pool_destroy(ohci->td_cache); 61 + ohci->td_cache = NULL; 62 + dma_pool_destroy(ohci->ed_cache); 63 + ohci->ed_cache = NULL; 68 64 } 69 65 70 66 /*-------------------------------------------------------------------------*/