Skip to content

Commit da944ad

Browse files
nathanchanceJarlPenguin
authored andcommitted
ASoC: msm-audio-pinctrl: Fix strlcpy usage in msm_gpioset_initialize
Clang warns: ../sound/soc/msm/msm-audio-pinctrl.c:127:31: warning: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Wstrlcpy-strlcat-size] gpioset_names_str, strlen(gpioset_names_str)+1); ~~~~~~~^~~~~~~~~~~~~~~~~~~~ ../sound/soc/msm/msm-audio-pinctrl.c:172:13: warning: size argument in 'strlcpy' call appears to be size of the source; expected the size of the destination [-Wstrlcpy-strlcat-size] strlen(gpioset_comb_str)+1); ~~~~~~~^~~~~~~~~~~~~~~~~~~ 2 warnings generated. Fixes: b9de234 ("ASoC: Add audio drivers for MSM 8952 targets") Signed-off-by: Nathan Chancellor <[email protected]>
1 parent 4652a44 commit da944ad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sound/soc/msm/msm-audio-pinctrl.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ int msm_gpioset_initialize(enum pinctrl_client client,
123123
ret = -ENOMEM;
124124
goto err;
125125
}
126-
strlcpy(gpioset_info[client].gpiosets[i],
127-
gpioset_names_str, strlen(gpioset_names_str)+1);
126+
strlcpy(gpioset_info[client].gpiosets[i], gpioset_names_str,
127+
sizeof(gpioset_info[client].gpiosets[i]));
128128
gpioset_names_str = NULL;
129129
}
130130
num_strings = 0;
@@ -168,8 +168,8 @@ int msm_gpioset_initialize(enum pinctrl_client client,
168168
}
169169

170170
strlcpy(gpioset_info[client].gpiosets_comb_names[i],
171-
gpioset_comb_str,
172-
strlen(gpioset_comb_str)+1);
171+
gpioset_comb_str,
172+
sizeof(gpioset_info[client].gpiosets_comb_names[i]));
173173
pr_debug("%s: GPIO configuration %s\n",
174174
__func__,
175175
gpioset_info[client].gpiosets_comb_names[i]);

0 commit comments

Comments
 (0)