From: Markus Elfring Date: Wed, 19 Nov 2014 10:38:38 +0000 (+0100) Subject: firmware class: Deletion of an unnecessary check before the function call "vunmap" X-Git-Tag: firefly_0821_release~176^2~2677^2~2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=daa3d67fa3b5a997761ba594c6bca41b3e78963f;p=firefly-linux-kernel-4.4.55.git firmware class: Deletion of an unnecessary check before the function call "vunmap" The vunmap() function performes also input parameter validation. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 9962744b59aa..58470c395301 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c @@ -591,8 +591,7 @@ static int fw_map_pages_buf(struct firmware_buf *buf) if (!buf->is_paged_buf) return 0; - if (buf->data) - vunmap(buf->data); + vunmap(buf->data); buf->data = vmap(buf->pages, buf->nr_pages, 0, PAGE_KERNEL_RO); if (!buf->data) return -ENOMEM;