asoc: msm_common: Use destination size for strlcpy
Fix compilation error due to strlcpy referring to source size instead of destination size. Change-Id: Ifcbb70342cefbeaf77575afd98780cd7fed0fac5 Signed-off-by: Ashish Jain <ashishj@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
dacb2cc698
commit
b1846bb750
@@ -31,6 +31,8 @@
|
|||||||
#define DEVICE_ENABLE 1
|
#define DEVICE_ENABLE 1
|
||||||
#define DEVICE_DISABLE 0
|
#define DEVICE_DISABLE 0
|
||||||
|
|
||||||
|
#define ARRAY_SZ 21
|
||||||
|
|
||||||
static struct attribute device_state_attr = {
|
static struct attribute device_state_attr = {
|
||||||
.name = "state",
|
.name = "state",
|
||||||
.mode = 0660,
|
.mode = 0660,
|
||||||
@@ -369,15 +371,15 @@ int msm_channel_map_get(struct snd_kcontrol *kcontrol,
|
|||||||
|
|
||||||
void msm_common_get_backend_name(const char *stream_name, char **backend_name)
|
void msm_common_get_backend_name(const char *stream_name, char **backend_name)
|
||||||
{
|
{
|
||||||
char arg[21] = {0};
|
char arg[ARRAY_SZ] = {0};
|
||||||
char value[61] = {0};
|
char value[61] = {0};
|
||||||
|
|
||||||
sscanf(stream_name, "%20[^-]-%60s", arg, value);
|
sscanf(stream_name, "%20[^-]-%60s", arg, value);
|
||||||
*backend_name = kzalloc(strlen(arg)+1, GFP_KERNEL);
|
*backend_name = kzalloc(ARRAY_SZ, GFP_KERNEL);
|
||||||
if (!(*backend_name))
|
if (!(*backend_name))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
strlcpy(*backend_name, arg, strlen(arg)+1);
|
strlcpy(*backend_name, arg, ARRAY_SZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
int msm_common_dai_link_init(struct snd_soc_pcm_runtime *rtd)
|
int msm_common_dai_link_init(struct snd_soc_pcm_runtime *rtd)
|
||||||
|
Reference in New Issue
Block a user