summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorFugang Duan <b38611@freescale.com>2016-01-11 16:10:10 +0800
committerLeonard Crestez <leonard.crestez@nxp.com>2018-08-24 12:41:33 +0300
commit2bfec01add7d3e9f754f1cd4f0463826df11ed58 (patch)
tree1527d7715b3925823f8789fbe0011d847165444a /drivers/misc
parent136ef694d1617bf9210d44b460aed5ead11b58a3 (diff)
MLK-12181 misc: at25: Cleaning up missing null-terminate in conjunction with strncpy
Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Fugang Duan <B38611@freescale.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/eeprom/at25.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/eeprom/at25.c b/drivers/misc/eeprom/at25.c
index 5afe4cd16569..67eb81aecfe4 100644
--- a/drivers/misc/eeprom/at25.c
+++ b/drivers/misc/eeprom/at25.c
@@ -249,7 +249,7 @@ static int at25_fw_to_chip(struct device *dev, struct spi_eeprom *chip)
u32 val;
memset(chip, 0, sizeof(*chip));
- strncpy(chip->name, "at25", sizeof(chip->name));
+ strlcpy(chip->name, "at25", sizeof(chip->name));
if (device_property_read_u32(dev, "size", &val) == 0 ||
device_property_read_u32(dev, "at25,byte-len", &val) == 0) {