mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
UPSTREAM: 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: 0bcd216c4741 ("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> (cherry picked from commit 85c2ceaafbd306814a3a4740bf4d95ac26a8b36a) Bug: 300502883 Change-Id: I235ea1bfc9d8bf0fef426dbc21881d755e3a5d67 Signed-off-by: cui yangpei <cuiyangpei@xiaomi.com>
This commit is contained in:
committed by
Suren Baghdasaryan
parent
c132d077eb
commit
606444fd06
@@ -1172,7 +1172,7 @@ static int damon_sysfs_update_target(struct damon_target *target,
|
||||
struct damon_ctx *ctx,
|
||||
struct damon_sysfs_target *sys_target)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
|
||||
if (damon_target_has_pid(ctx)) {
|
||||
err = damon_sysfs_update_target_pid(target, sys_target->pid);
|
||||
|
||||
Reference in New Issue
Block a user