mm/damon/sysfs: eliminate potential uninitialized variable warning
authorDan Carpenter <dan.carpenter@linaro.org>
Mon, 6 Nov 2023 14:07:40 +0000 (17:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Dec 2023 17:45:11 +0000 (18:45 +0100)
commit577209e844bf0e879f6bff128d4d80f0a5fd8ace
treecc998425ce6b1c50fd9d0c1d7dd0060aeb684571
parent45d72eadf21ab807f477e7fffd5767b17c7a2aaf
mm/damon/sysfs: eliminate potential uninitialized variable warning

[ Upstream commit 85c2ceaafbd306814a3a4740bf4d95ac26a8b36a ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
mm/damon/sysfs.c