[source] net: ar8327: replace sprintf() by scnprintf()

LEDE Commits lede-commits at lists.infradead.org
Thu Dec 1 06:47:56 PST 2016


blogic pushed a commit to source.git, branch master:
https://git.lede-project.org/65b20d8b64bb5c6d8b9375d3952899b6aaaa302e

commit 65b20d8b64bb5c6d8b9375d3952899b6aaaa302e
Author: Pavel Kubelun <be.dissent at gmail.com>
AuthorDate: Mon Nov 28 15:14:50 2016 +0300

    net: ar8327: replace sprintf() by scnprintf()
    
    Import from https://chromium.googlesource.com/chromiumos/third_party/kernel/+/fd0c41c7b9327ce003f44df38ce42556fb177b17%5E%21/#F0
    Signed-off-by: Pavel Kubelun <be.dissent at gmail.com>
    
    CHROMIUM: drivers: ar8216: replace sprintf() by scnprintf()
    
    BUG=chrome-os-partner:33096
    TEST=none
    
    Change-Id: Ib82035c9f2769a86d3e90f9573a09e5700ff5676
    Signed-off-by: Mathieu Olivari <mathieu at codeaurora.org>
    Reviewed-on: https://chromium-review.googlesource.com/232829
    Reviewed-by: Matthias Kaehlcke <mka at chromium.org>
    Tested-by: Toshi Kikuchi <toshik at chromium.org>
    Reviewed-by: Toshi Kikuchi <toshik at chromium.org>
---
 target/linux/generic/files/drivers/net/phy/ar8327.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/target/linux/generic/files/drivers/net/phy/ar8327.c b/target/linux/generic/files/drivers/net/phy/ar8327.c
index d5cc97b..d2a5a5b 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8327.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8327.c
@@ -306,7 +306,7 @@ ar8327_led_enable_hw_mode_show(struct device *dev,
 	struct ar8327_led *aled = led_cdev_to_ar8327_led(led_cdev);
 	ssize_t ret = 0;
 
-	ret += sprintf(buf, "%d\n", aled->enable_hw_mode);
+	ret += scnprintf(buf, PAGE_SIZE, "%d\n", aled->enable_hw_mode);
 
 	return ret;
 }
@@ -1433,4 +1433,3 @@ const struct ar8xxx_chip ar8337_chip = {
 	.mib_decs = ar8236_mibs,
 	.mib_func = AR8327_REG_MIB_FUNC
 };
-



More information about the lede-commits mailing list