From: Markus Elfring Date: Sun, 24 Jul 2016 08:16:56 +0000 (+0200) Subject: firmware-gsmi: Delete an unnecessary check before the function call "dma_pool_destroy" X-Git-Tag: v4.9-rc1~166^2~2^2~11 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=d520dd1f348dcaafcb8ce804b2a5ebb1be004719;p=karo-tx-linux.git firmware-gsmi: Delete an unnecessary check before the function call "dma_pool_destroy" The dma_pool_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Cc: Greg KH Cc: Julia Lawall Cc: Mike Waychison Cc: Michel Lespinasse Signed-off-by: Matt Fleming --- diff --git a/drivers/firmware/google/gsmi.c b/drivers/firmware/google/gsmi.c index f1ab05ea56bb..c46387160976 100644 --- a/drivers/firmware/google/gsmi.c +++ b/drivers/firmware/google/gsmi.c @@ -910,8 +910,7 @@ out_err: gsmi_buf_free(gsmi_dev.param_buf); gsmi_buf_free(gsmi_dev.data_buf); gsmi_buf_free(gsmi_dev.name_buf); - if (gsmi_dev.dma_pool) - dma_pool_destroy(gsmi_dev.dma_pool); + dma_pool_destroy(gsmi_dev.dma_pool); platform_device_unregister(gsmi_dev.pdev); pr_info("gsmi: failed to load: %d\n", ret); return ret;