Skip to content

Commit

Permalink
i2c: sun6-p2wi: fix call to snprintf
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Boris BREZILLON authored and Wolfram Sang committed Jun 17, 2014
1 parent c51bd6a commit 4632a93
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/busses/i2c-sun6i-p2wi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4632a93

Please sign in to comment.