aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/imx-drm
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2014-02-28 11:39:42 -0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-28 14:56:34 -0800
commit98dd3b2a3ad2b234ac9c6e7a233dde21e6e37da6 (patch)
treec119ff8463f8c43f3199c3a8f58f47fee1db5bb7 /drivers/staging/imx-drm
parentb6d8115e4ef497fde9363a72716793399a1060c2 (diff)
downloadlinux-stericsson-98dd3b2a3ad2b234ac9c6e7a233dde21e6e37da6.tar.gz
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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/imx-drm')
-rw-r--r--drivers/staging/imx-drm/imx-ldb.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/imx-drm/imx-ldb.c b/drivers/staging/imx-drm/imx-ldb.c
index abf85170f6d6..daa54df4527f 100644
--- a/drivers/staging/imx-drm/imx-ldb.c
+++ b/drivers/staging/imx-drm/imx-ldb.c
@@ -334,12 +334,12 @@ static int imx_ldb_get_clk(struct imx_ldb *ldb, int chno)
{
char clkname[16];
- sprintf(clkname, "di%d", chno);
+ snprintf(clkname, sizeof(clkname), "di%d", chno);
ldb->clk[chno] = devm_clk_get(ldb->dev, clkname);
if (IS_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);
return PTR_ERR_OR_ZERO(ldb->clk_pll[chno]);