Skip to content

Commit

Permalink
firmware-gsmi: Delete an unnecessary check before the function call "…
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Markus Elfring authored and Matt Fleming committed Sep 9, 2016
1 parent ac0e94b commit d520dd1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/firmware/google/gsmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,8 +910,7 @@ static __init int gsmi_init(void)
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;
Expand Down

0 comments on commit d520dd1

Please sign in to comment.