Skip to content

Commit daa3d67

Browse files
elfringgregkh
authored andcommitted
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>
1 parent 000deba commit daa3d67

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/base/firmware_class.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,7 @@ static int fw_map_pages_buf(struct firmware_buf *buf)
591591
if (!buf->is_paged_buf)
592592
return 0;
593593

594-
if (buf->data)
595-
vunmap(buf->data);
594+
vunmap(buf->data);
596595
buf->data = vmap(buf->pages, buf->nr_pages, 0, PAGE_KERNEL_RO);
597596
if (!buf->data)
598597
return -ENOMEM;

0 commit comments

Comments
 (0)