Commit 98dd3b2a authored by Fabio Estevam's avatar Fabio Estevam Committed by Greg Kroah-Hartman

imx-drm: imx-ldb: Use snprintf()

Use snprintf() in order to fix the following static checker warning:

drivers/staging/imx-drm/imx-ldb.c:340 imx_ldb_get_clk() error: format string overflow. buf_size: 16 length: 18
probably 18 is theory and not real life, but 16 is based on
theory as well.
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFabio Estevam <fabio.estevam@freescale.com>
Acked-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b6d8115e
...@@ -334,12 +334,12 @@ static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno) ...@@ -334,12 +334,12 @@ static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno)
{ {
char clkname[16]; char clkname[16];
sprintf(clkname, "di%d", chno); snprintf(clkname, sizeof(clkname), "di%d", chno);
ldb->clk[chno] = devm_clk_get(ldb->dev, clkname); ldb->clk[chno] = devm_clk_get(ldb->dev, clkname);
if (IS_ERR(ldb->clk[chno])) if (IS_ERR(ldb->clk[chno]))
return PTR_ERR(ldb->clk[chno]); return PTR_ERR(ldb->clk[chno]);
sprintf(clkname, "di%d_pll", chno); snprintf(clkname, sizeof(clkname), "di%d_pll", chno);
ldb->clk_pll[chno] = devm_clk_get(ldb->dev, clkname); ldb->clk_pll[chno] = devm_clk_get(ldb->dev, clkname);
return PTR_ERR_OR_ZERO(ldb->clk_pll[chno]); return PTR_ERR_OR_ZERO(ldb->clk_pll[chno]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment