diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2014-06-13 12:23:48 +0200 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-06-17 14:28:04 +0200 |
commit | 4632a93f015caf6d7db4352f37aab74a39e60d7a (patch) | |
tree | c044c403acffac9b0cf4f1490ca2a2d819a8e490 /drivers/i2c/busses | |
parent | c51bd6acf59f24f2ec4334689329f1741f071621 (diff) |
i2c: sun6-p2wi: fix call to snprintf
Fixes possible issue in case pdev name contains formatting characters.
Signed-off-by: Boris BREZILLON <boris.brezillon@free-electrons.com>
Reported-by: Kees Cook <keescook@google.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-sun6i-p2wi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sun6i-p2wi.c b/drivers/i2c/busses/i2c-sun6i-p2wi.c index 5d2d67820c98..09de4fd12d57 100644 --- a/drivers/i2c/busses/i2c-sun6i-p2wi.c +++ b/drivers/i2c/busses/i2c-sun6i-p2wi.c @@ -237,7 +237,7 @@ static int p2wi_probe(struct platform_device *pdev) if (IS_ERR(p2wi->regs)) return PTR_ERR(p2wi->regs); - snprintf(p2wi->adapter.name, sizeof(p2wi->adapter.name), pdev->name); + strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name)); irq = platform_get_irq(pdev, 0); if (irq < 0) { dev_err(dev, "failed to retrieve irq: %d\n", irq); |