From nobody Fri Dec 19 20:34:45 2025 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 78BE817B519; Sun, 24 Mar 2024 23:42:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323727; cv=none; b=dYFYCJPBXcns4gn8CslKmUBzpwivohUraMMxxxprfxQGLPti3XFyvICPnVnEPbyaaNvhjXa40uMgYdNFLDWZI5UMT0Gfb0RQlOtfrmE85C3jYUNsmj+tNEIXH+vo96XtNOIORQtf+qkrddXzzu7WRTOuilEoXcG78dV9g+mjhmE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711323727; c=relaxed/simple; bh=FU8bOYJOpA7z5HZUBn8V79nlonCFP1MChAiD587xR18=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ArCZGgWRnS5h0CYhpyWoxt0joBX3I/GejCwzt+31KcneP4REJLFXjxL0UQQnGcXi8RYgPRDEYyZvOMv/yuTB0WT5UJ1Q1AisTzbi9fmX7J7gxiTe6IL70ZK5VCR1RZFKKZAylZIOtx/44Top8/OEeWZZAfNvs73zj32LyKiU0Pw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DzpW7mxr; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DzpW7mxr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 573A4C433C7; Sun, 24 Mar 2024 23:42:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711323726; bh=FU8bOYJOpA7z5HZUBn8V79nlonCFP1MChAiD587xR18=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DzpW7mxrH+GLwsfSeFj+kW9LBbzI2zpw//kPq5gGrBAWVMHLstju8CdLd1zaRojPH jq+xBt8LCP3vaG5BytdyibwPOVJDIZLr3l5judsz/88QHmmGtPpElkgl3UE0zajW+9 zTb6C1eJZcK9oykD8W0tzUmc/70y+MmGbtzRaoFeg7dMSJ+9AIedee97b2UTua3XxS VnlTyfYBIRMBRmapWbPRVupi4lKPLbLY/MPRMs51brmqZzKT6R9cGSnulFbXGvF30t 5UyW2zzG4fVpg3ckQDTz6wX6CKwOLXhfgEPxgS5qgZob56kkwyxOPvxihPa94cW8oB P+gAGxHY29lfg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Viresh Kumar , kernel test robot , Dhruva Gole , Sasha Levin Subject: [PATCH 5.10 099/238] OPP: debugfs: Fix warning around icc_get_name() Date: Sun, 24 Mar 2024 19:38:07 -0400 Message-ID: <20240324234027.1354210-100-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240324234027.1354210-1-sashal@kernel.org> References: <20240324234027.1354210-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Viresh Kumar [ Upstream commit 28330ceb953e39880ea77da4895bb902a1244860 ] If the kernel isn't built with interconnect support, icc_get_name() returns NULL and we get following warning: drivers/opp/debugfs.c: In function 'bw_name_read': drivers/opp/debugfs.c:43:42: error: '%.62s' directive argument is null [-We= rror=3Dformat-overflow=3D] i =3D scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path)); Fix it. Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402141313.81ltVF5g-lkp@int= el.com/ Fixes: 0430b1d5704b0 ("opp: Expose bandwidth information via debugfs") Signed-off-by: Viresh Kumar Reviewed-by: Dhruva Gole Signed-off-by: Sasha Levin --- drivers/opp/debugfs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/opp/debugfs.c b/drivers/opp/debugfs.c index 60f4ff8e044d1..016dea5a412be 100644 --- a/drivers/opp/debugfs.c +++ b/drivers/opp/debugfs.c @@ -36,10 +36,12 @@ static ssize_t bw_name_read(struct file *fp, char __use= r *userbuf, size_t count, loff_t *ppos) { struct icc_path *path =3D fp->private_data; + const char *name =3D icc_get_name(path); char buf[64]; - int i; + int i =3D 0; =20 - i =3D scnprintf(buf, sizeof(buf), "%.62s\n", icc_get_name(path)); + if (name) + i =3D scnprintf(buf, sizeof(buf), "%.62s\n", name); =20 return simple_read_from_buffer(userbuf, count, ppos, buf, i); } --=20 2.43.0