提交 783fd6fa 编写于 作者: R Roel Kluin 提交者: Ben Dooks

i2c: strncpy does not null terminate string

strlcpy() will always null terminate the string.
Signed-off-by: NRoel Kluin <roel.kluin@gmail.com>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 0e014e92
......@@ -879,7 +879,7 @@ omap_i2c_probe(struct platform_device *pdev)
i2c_set_adapdata(adap, dev);
adap->owner = THIS_MODULE;
adap->class = I2C_CLASS_HWMON;
strncpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
strlcpy(adap->name, "OMAP I2C adapter", sizeof(adap->name));
adap->algo = &omap_i2c_algo;
adap->dev.parent = &pdev->dev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册