Skip to content

Commit 85c2cea

Browse files
Dan Carpenterakpm00
authored andcommitted
mm/damon/sysfs: eliminate potential uninitialized variable warning
The "err" variable is not initialized if damon_target_has_pid(ctx) is false and sys_target->regions->nr is zero. Link: https://lkml.kernel.org/r/739e6aaf-a634-4e33-98a8-16546379ec9f@moroto.mountain Fixes: 0bcd216 ("mm/damon/sysfs: update monitoring target regions for online input commit") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent b85ea95 commit 85c2cea

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

mm/damon/sysfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ static int damon_sysfs_update_target(struct damon_target *target,
11721172
struct damon_ctx *ctx,
11731173
struct damon_sysfs_target *sys_target)
11741174
{
1175-
int err;
1175+
int err = 0;
11761176

11771177
if (damon_target_has_pid(ctx)) {
11781178
err = damon_sysfs_update_target_pid(target, sys_target->pid);

0 commit comments

Comments
 (0)