From: Colin Ian King Date: Fri, 19 Oct 2018 12:58:01 +0000 (+0100) Subject: test_firmware: fix error return getting clobbered X-Git-Tag: v4.19.9~107 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27b504af882ba40e4bbada1fec430ffef98f12ca;p=platform%2Fkernel%2Flinux-rpi3.git test_firmware: fix error return getting clobbered [ Upstream commit 8bb0a88600f0267cfcc245d34f8c4abe8c282713 ] 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- diff --git a/lib/test_firmware.c b/lib/test_firmware.c index b984806d7..7cab9a9 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -837,6 +837,7 @@ static ssize_t read_firmware_show(struct device *dev, if (req->fw->size > PAGE_SIZE) { pr_err("Testing interface must use PAGE_SIZE firmware for now\n"); rc = -EINVAL; + goto out; } memcpy(buf, req->fw->data, req->fw->size);