summaryrefslogtreecommitdiff
path: root/drivers/base/firmware_class.c
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2014-11-19 11:38:38 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-26 19:41:15 -0800
commitdaa3d67fa3b5a997761ba594c6bca41b3e78963f (patch)
tree2430ce99e1ce93da854d7d60636fe34ad034e170 /drivers/base/firmware_class.c
parent000deba73a85381d393d58ce0a2a5ccf6a096b5a (diff)
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 <elfring@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/base/firmware_class.c')
-rw-r--r--drivers/base/firmware_class.c3
1 files changed, 1 insertions, 2 deletions
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;