Skip to content

Commit 8bb0a88

Browse files
Colin Ian Kinggregkh
authored andcommitted
test_firmware: fix error return getting clobbered
In the case where eq->fw->size > PAGE_SIZE the error return rc is being set to EINVAL however this is being overwritten to rc = req->fw->size because the error exit path via label 'out' is not being taken. Fix this by adding the jump to the error exit path 'out'. Detected by CoverityScan, CID#1453465 ("Unused value") Fixes: c92316b ("test_firmware: add batched firmware tests") Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0749aa2 commit 8bb0a88

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/test_firmware.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@ static ssize_t read_firmware_show(struct device *dev,
837837
if (req->fw->size > PAGE_SIZE) {
838838
pr_err("Testing interface must use PAGE_SIZE firmware for now\n");
839839
rc = -EINVAL;
840+
goto out;
840841
}
841842
memcpy(buf, req->fw->data, req->fw->size);
842843

0 commit comments

Comments
 (0)