ASoC: wm_adsp: memory leak in wm_adsp_create_control()
There are two return paths which don't kfree(name). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
6ab2b7b415
commit
9dbce04402
1 changed files with 4 additions and 2 deletions
|
@ -836,7 +836,8 @@ static int wm_adsp_create_control(struct snd_soc_codec *codec,
|
||||||
region_name = "ZM";
|
region_name = "ZM";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return -EINVAL;
|
ret = -EINVAL;
|
||||||
|
goto err_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(name, PAGE_SIZE, "DSP%d %s %x",
|
snprintf(name, PAGE_SIZE, "DSP%d %s %x",
|
||||||
|
@ -847,7 +848,7 @@ static int wm_adsp_create_control(struct snd_soc_codec *codec,
|
||||||
if (!strcmp(ctl->name, name)) {
|
if (!strcmp(ctl->name, name)) {
|
||||||
if (!ctl->enabled)
|
if (!ctl->enabled)
|
||||||
ctl->enabled = 1;
|
ctl->enabled = 1;
|
||||||
return 0;
|
goto found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -887,6 +888,7 @@ static int wm_adsp_create_control(struct snd_soc_codec *codec,
|
||||||
INIT_WORK(&ctl_work->work, wm_adsp_ctl_work);
|
INIT_WORK(&ctl_work->work, wm_adsp_ctl_work);
|
||||||
schedule_work(&ctl_work->work);
|
schedule_work(&ctl_work->work);
|
||||||
|
|
||||||
|
found:
|
||||||
kfree(name);
|
kfree(name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Add table
Reference in a new issue