From patchwork Mon Nov 6 14:07:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13446957 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 642E5C4332F for ; Mon, 6 Nov 2023 14:07:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C7F396B0254; Mon, 6 Nov 2023 09:07:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C08A16B027A; Mon, 6 Nov 2023 09:07:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA9126B027B; Mon, 6 Nov 2023 09:07:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 8AB9F6B0254 for ; Mon, 6 Nov 2023 09:07:47 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5568B40135 for ; Mon, 6 Nov 2023 14:07:47 +0000 (UTC) X-FDA: 81427707774.04.B517BC4 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf27.hostedemail.com (Postfix) with ESMTP id 609AE40030 for ; Mon, 6 Nov 2023 14:07:45 +0000 (UTC) Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=onsY12aA; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf27.hostedemail.com: domain of dan.carpenter@linaro.org designates 209.85.208.44 as permitted sender) smtp.mailfrom=dan.carpenter@linaro.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1699279665; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=8jgVbQBMI5zlzuMwMovjOCtuCkKuAbIOmNERMV3iGn8=; b=gN4nOPbczhGfA5dJ04Bs9lRBvqSO5jSSPBGCUIk1XCLTjEBP9sf4wCq9x4ctnxZ/zzQkId /txRulSVvEAebaUKiiHc7NPVo3PyF+FHmN6kT4fqQCOL8pJs+sraF4det1HuHtI+Pyc+0w QX4KOW68nZ/l6uNFUezX9u7ZPPYO50E= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=linaro.org header.s=google header.b=onsY12aA; dmarc=pass (policy=none) header.from=linaro.org; spf=pass (imf27.hostedemail.com: domain of dan.carpenter@linaro.org designates 209.85.208.44 as permitted sender) smtp.mailfrom=dan.carpenter@linaro.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1699279665; a=rsa-sha256; cv=none; b=AUwO+y82NjcBjpNF1n30pqFfCIjIyTN45WToL31qMJlwS2spP9sHr4B6lmRE14Dt9qqnw5 6WxAk5fTBIlG0HdKKUCAmD+6WWBZp2TRrQkv+hx1zlsJ8oDmxRaw0/HPvYOOjRWa7iprEh MgeciF/h9hrc4VcC3G5UAOhX9FukjfM= Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-53e70b0a218so7711671a12.2 for ; Mon, 06 Nov 2023 06:07:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699279664; x=1699884464; darn=kvack.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=8jgVbQBMI5zlzuMwMovjOCtuCkKuAbIOmNERMV3iGn8=; b=onsY12aAud8EaImei5xXhKLdfY+D5E10OK5ztJX5RC7dOn5D30/NDMH4UiX1YMsf8I 2DHFCXk8Etwg599YlrpDYZXM5NVReA3VSO1ShtuLMlqT4V+hs1bbjSG/1bGESbSw1KGb HZFjHu/Y4+PxeKaOlorcj3HoqMhuF0ZxaafqLYboAE6ZBBo/R4lFFrWc9uhDpPhZYKeU 90PThlq8wmSKkQLENU4iX5KAE7bKwuLo1W1dSCHNHvxWyXFs/vRGSb3QyFxmGBYzlg9M 2OFjOj2vIkdEreQ4GiefyBOOftbhuxOIx9gn2ZJn75Ah+FOcJY5MfJXrqsvvSLlGUTrU F6rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699279664; x=1699884464; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=8jgVbQBMI5zlzuMwMovjOCtuCkKuAbIOmNERMV3iGn8=; b=f/IA2zVWu0Xl0Lf6xXqVU+bWS35VoAfevjR1BsbITegNInW8gB6yfc7qalJ0N3C/ci IZPAyykyxtoWXf73KJ+PPKQDgreqvEJjwf7VE/MBfmN52C0LybwPvhPygdGQkTe82xEC fhAY5bp6pWQOITJFTq4jjCvUajr2IUXezJCTevnqdrNbUfp7UXm1/GtRGO6p3Si07KXx QQ6cEd082g3/KD0OqIMp5+t31mPhZAKwBS6OjqOaVpAP/Bb5um2lpX58ywGZWRyDNA75 9IBmvePBpLLFNfrdUDIkIxAc1mD69Bi5WngbGxddRstR9Kpchz4F0mthutZx/UhAlHY9 gGgA== X-Gm-Message-State: AOJu0Yxza5gK5zUq3G8MWjSZivxpjjNZxY+B06vsgHRW4TY3rvr6bJpB FnhyaBM8JlbJjhfyoayGsgQcYw== X-Google-Smtp-Source: AGHT+IEijAt6Ah4VQuBzxP5KzJ7RXy+VDCSC0/AOkIK58u2UR5ihryIsP11l3ucRzoRTNGBW+qK6/g== X-Received: by 2002:a17:906:db01:b0:9d5:9ff5:ce with SMTP id xj1-20020a170906db0100b009d59ff500cemr12398157ejb.34.1699279663769; Mon, 06 Nov 2023 06:07:43 -0800 (PST) Received: from localhost ([102.36.222.112]) by smtp.gmail.com with ESMTPSA id kj26-20020a170907765a00b00988f168811bsm4164464ejc.135.2023.11.06.06.07.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:07:43 -0800 (PST) Date: Mon, 6 Nov 2023 17:07:40 +0300 From: Dan Carpenter To: SeongJae Park Cc: Andrew Morton , damon@lists.linux.dev, linux-mm@kvack.org, kernel-janitors@vger.kernel.org Subject: [PATCH] mm/damon/sysfs: eliminate potential uninitialized variable warning Message-ID: <739e6aaf-a634-4e33-98a8-16546379ec9f@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 609AE40030 X-Stat-Signature: dsy6zgnfnecd7d4w495cxsb4aw1x6a68 X-HE-Tag: 1699279665-833401 X-HE-Meta: U2FsdGVkX1+9VUqS90Ci82Ypy9J84OdqyMiUZQLUK4i4xaU07hzvopFGDqpusoT+vnlwVBNALxBpiMdieivu0ctZPERz0sCoEW5ANckuxkrTtOnz2oUINLElkOPBFNfcYgRqyMfACiAnHXg6BaBfWpRUpiyTDOJYXRrE4zlOucfnlGY7TN9Jbe47kRl4oxOCXwU34Jic3S8PuJIS+Ay+g6HMeVzXhTenRYEs8jZ2lyb1MX1PBOgh+HkWMrP46GbSExJQaHMsegDfjWSgoxBaf709NkXeWd7XOiV9wNmjUFZSM1EbrClzEGr7cJ0CEdyHpPzhUmSMh17Xw7BoqSyj38JqDhQn4CA6vy1Wye0iIivGcV4x+vdagTYozisAuntntPaI54iAjt1pLqSso8imHsOT1GftvOP6c+zAgWIsZDgYOc9+fy0BP/bnrR+Z57wKvTnCYj5hZXDdt3ZShR7Gzt48q7K8RHw6tA825qGjNLTLeE6Fgq+vcuKSyAJW3JHg8lUvrMzRFfj1I7L8QKxXs1dByWRl7TUTsusoRy+c8InlaBzZR5fOfqgJR8AbBjPwcL1/c1FyDZdNoOtwp2sp3a0ReTJYguHYqAl2uSKMVFma/S85a05/N3nNNmk1bJVk2pPoLmuMhla8Otu3zVZfbLelD8yM72LvjOgKFuzRXer9pS+FJJqOvRwW1Z1hl+iN7i2O7CS5W3IslxzMZ7sWZi2zbt37tHLshwMQuUZyvoDEMYUkOEmHh+fsdfowqL81e3E9ogST3SM2zrOmpRoRyxO+IZRq+oKQbC4Jf1r6mTTtYqurpBD6fVWbjB9ZAVmxOCBEsyt0iSxV9A/Hv1Ri4Lg3O4kYu2YkcghBVTg1VgloKMKMwX6JdNkZ+lXqnXZu0KNj70vlu6CsjkBctJ5SPLMPmvnfhc9f/4TqCMXmdlFhqeveVNDcpAHQGB2M33MknXCQ8sP2aNDUwB1wIqo 6kPuQAY3 tC+g/Y4CcX5fsHRvz5BEt5gTsRvRs/jd1/T4T0Xiv8cpu7CdS8ipIHhK/aq2jzcADq/RhQrSMVihEQJ2EbtfHNr6OFp4UCUmKp1kQEAfuyNHi8DiC4qSwcP+Fh0Jk1BvtSv5d8Xs144k3pxCiEs/TfhGZCmNR/Tdje1KnVK0ZZocMucAa3OehyN5pGQ2oEqRuHjsbg3QP2RLiOAOR/Dik9UZkOIrpOHGdQslSkOslvehMWVcmbhn7RMkLvh4vpb/RX2i6J8G9WKXuGxwGe4xHuI0DU1al3Kiw+Kvk2NxfW02E53Dl8bxHdtUKk8gmBukbdR7wlgemy6437OraiStS9mknbytQTT0SNx9FFk1iXJVYYQVgyQfNco+aRsAXMcArPbSFNeJQjKBFhWgsfsrKwPzrvg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000063, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The "err" variable is not initialized if damon_target_has_pid(ctx) is false and sys_target->regions->nr is zero. Fixes: 0bcd216c4741 ("mm/damon/sysfs: update monitoring target regions for online input commit") Signed-off-by: Dan Carpenter Reviewed-by: SeongJae Park --- mm/damon/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c index e27846708b5a..1dfa96d4de99 100644 --- a/mm/damon/sysfs.c +++ b/mm/damon/sysfs.c @@ -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);