Skip to content

Commit

Permalink
firmware class: Deletion of an unnecessary check before the function …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
Markus Elfring authored and Greg Kroah-Hartman committed Nov 27, 2014
1 parent 000deba commit daa3d67
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit daa3d67

Please sign in to comment.