[PATCH 14/20] drm/imx/ipuv3/imx-ldb: Increase buffer size to ensure all possible values can be stored
From: Lee Jones
Date: Thu Aug 24 2023 - 03:38:50 EST
When converting from int to string, we must allow for up to 10-chars (2147483647).
Fixes the following W=1 kernel build warning(s):
drivers/gpu/drm/imx/ipuv3/imx-ldb.c: In function ‘imx_ldb_probe’:
drivers/gpu/drm/imx/ipuv3/imx-ldb.c:659:39: warning: ‘_sel’ directive writing 4 bytes into a region of size between 3 and 13 [-Wformat-overflow=]
drivers/gpu/drm/imx/ipuv3/imx-ldb.c:659:17: note: ‘sprintf’ output between 8 and 18 bytes into a destination of size 16
Signed-off-by: Lee Jones <lee@xxxxxxxxxx>
---
Cc: Philipp Zabel <p.zabel@xxxxxxxxxxxxxx>
Cc: David Airlie <airlied@xxxxxxxxx>
Cc: Daniel Vetter <daniel@xxxxxxxx>
Cc: Shawn Guo <shawnguo@xxxxxxxxxx>
Cc: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
Cc: Pengutronix Kernel Team <kernel@xxxxxxxxxxxxxx>
Cc: Fabio Estevam <festevam@xxxxxxxxx>
Cc: NXP Linux Team <linux-imx@xxxxxxx>
Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx
Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
---
drivers/gpu/drm/imx/ipuv3/imx-ldb.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
index c45fc8f4744d0..0404781dcd176 100644
--- a/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
+++ b/drivers/gpu/drm/imx/ipuv3/imx-ldb.c
@@ -654,7 +654,7 @@ static int imx_ldb_probe(struct platform_device *pdev)
* Map them all to di0_sel...di3_sel.
*/
for (i = 0; i < 4; i++) {
- char clkname[16];
+ char clkname[18];
sprintf(clkname, "di%d_sel", i);
imx_ldb->clk_sel[i] = devm_clk_get(imx_ldb->dev, clkname);
--
2.42.0.rc1.204.g551eb34607-goog