提交 4632a93f 编写于 作者: B Boris BREZILLON 提交者: Wolfram Sang

i2c: sun6-p2wi: fix call to snprintf

Fixes possible issue in case pdev name contains formatting characters.
Signed-off-by: NBoris BREZILLON <boris.brezillon@free-electrons.com>
Reported-by: NKees Cook <keescook@google.com>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 c51bd6ac
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册