Skip to content

Commit

Permalink
ARM: OMAP2+: using strlcpy instead of strncpy
Browse files Browse the repository at this point in the history
the fields must be null-terminated:
the caller may use it as null-terminted string, next.

Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Chen Gang authored and Tony Lindgren committed Feb 4, 2013
1 parent 61338d5 commit c8d4baf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/mach-omap2/twl-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/i2c.h>
#include <linux/i2c/twl.h>
#include <linux/gpio.h>
#include <linux/string.h>
#include <linux/regulator/machine.h>
#include <linux/regulator/fixed.h>

Expand Down Expand Up @@ -56,7 +57,7 @@ void __init omap_pmic_init(int bus, u32 clkrate,
struct twl4030_platform_data *pmic_data)
{
omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
strncpy(pmic_i2c_board_info.type, pmic_type,
strlcpy(pmic_i2c_board_info.type, pmic_type,
sizeof(pmic_i2c_board_info.type));
pmic_i2c_board_info.irq = pmic_irq;
pmic_i2c_board_info.platform_data = pmic_data;
Expand Down

0 comments on commit c8d4baf

Please sign in to comment.