Static analysis complains that in some cases, an uninitialized 'rc' can get returned from action_update_fw(). Since this can only happen in a 'no-op' case, initialize rc to 0.
Signed-off-by: Vishal Verma <[email protected]> --- cxl/memdev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cxl/memdev.c b/cxl/memdev.c index 1ad871a..f6a2d3f 100644 --- a/cxl/memdev.c +++ b/cxl/memdev.c @@ -679,7 +679,7 @@ static int action_update_fw(struct cxl_memdev *memdev, const char *devname = cxl_memdev_get_devname(memdev); struct json_object *jmemdev; unsigned long flags; - int rc; + int rc = 0; if (param.cancel) return cxl_memdev_cancel_fw_update(memdev); --- base-commit: 32cec0c5cfe669940107ce030beeb1e02e5a767b change-id: 20230731-coverity-fix-edc28fd6e0fe Best regards, -- Vishal Verma <[email protected]>
