diff options
author | Boris BREZILLON <boris.brezillon@free-electrons.com> | 2014-06-13 06:23:48 -0400 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2014-06-17 08:28:04 -0400 |
commit | 4632a93f015caf6d7db4352f37aab74a39e60d7a (patch) | |
tree | c044c403acffac9b0cf4f1490ca2a2d819a8e490 | |
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>
-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) | |||
237 | if (IS_ERR(p2wi->regs)) | 237 | if (IS_ERR(p2wi->regs)) |
238 | return PTR_ERR(p2wi->regs); | 238 | return PTR_ERR(p2wi->regs); |
239 | 239 | ||
240 | snprintf(p2wi->adapter.name, sizeof(p2wi->adapter.name), pdev->name); | 240 | strlcpy(p2wi->adapter.name, pdev->name, sizeof(p2wi->adapter.name)); |
241 | irq = platform_get_irq(pdev, 0); | 241 | irq = platform_get_irq(pdev, 0); |
242 | if (irq < 0) { | 242 | if (irq < 0) { |
243 | dev_err(dev, "failed to retrieve irq: %d\n", irq); | 243 | dev_err(dev, "failed to retrieve irq: %d\n", irq); |