diff options
author | Colin Ian King <colin.king@canonical.com> | 2018-10-19 08:58:01 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-11-11 12:18:04 -0500 |
commit | 8bb0a88600f0267cfcc245d34f8c4abe8c282713 (patch) | |
tree | 51c5d10e28d418b3082847b920035beeed317993 | |
parent | 0749aa25af82c690395a96e799cd2c6e54c459cf (diff) |
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: c92316bf8e94 ("test_firmware: add batched firmware tests")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | lib/test_firmware.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/test_firmware.c b/lib/test_firmware.c index b984806d7d7b..7cab9a9869ac 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c | |||
@@ -837,6 +837,7 @@ static ssize_t read_firmware_show(struct device *dev, | |||
837 | if (req->fw->size > PAGE_SIZE) { | 837 | if (req->fw->size > PAGE_SIZE) { |
838 | pr_err("Testing interface must use PAGE_SIZE firmware for now\n"); | 838 | pr_err("Testing interface must use PAGE_SIZE firmware for now\n"); |
839 | rc = -EINVAL; | 839 | rc = -EINVAL; |
840 | goto out; | ||
840 | } | 841 | } |
841 | memcpy(buf, req->fw->data, req->fw->size); | 842 | memcpy(buf, req->fw->data, req->fw->size); |
842 | 843 | ||