summaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2016-07-24 10:16:56 +0200
committerMatt Fleming <matt@codeblueprint.co.uk>2016-09-09 17:08:45 +0200
commitd520dd1f348dcaafcb8ce804b2a5ebb1be004719 (patch)
tree44f02265d055375d49df1b44408645d5aa055cf0 /drivers/firmware
parentx86/efi: Initialize status to ensure garbage is not returned on small size (diff)
downloadlinux-d520dd1f348dcaafcb8ce804b2a5ebb1be004719.tar.xz
linux-d520dd1f348dcaafcb8ce804b2a5ebb1be004719.zip
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 <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>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/google/gsmi.c3
1 files changed, 1 insertions, 2 deletions
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;