firmware-gsmi: Delete an unnecessary check before the function call "dma_pool_destroy"
authorMarkus Elfring <elfring@users.sourceforge.net>
Sun, 24 Jul 2016 08:16:56 +0000 (10:16 +0200)
committerMatt Fleming <matt@codeblueprint.co.uk>
Fri, 9 Sep 2016 15:08:45 +0000 (16:08 +0100)
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 <elfring@users.sourceforge.net>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Mike Waychison <mikew@google.com>
Cc: Michel Lespinasse <walken@google.com>
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
drivers/firmware/google/gsmi.c

index f1ab05ea56bbc61ca85adf16b438016a1f762349..c463871609764d276f80be43e6bf587da5ea8862 100644 (file)
@@ -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;