mirror of
https://github.com/torvalds/linux
synced 2024-09-20 19:17:24 +00:00
ASoC: core: Fix Null-point-dereference in fmt_single_name()
Check the return value of devm_kstrdup() in case of
Null-point-dereference.
Fixes: 45dd9943fc
("ASoC: core: remove artificial component and DAI name constraint")
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Link: https://lore.kernel.org/r/20210524024941.159952-1-wangkefeng.wang@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
af2702549d
commit
41daf6ba59
|
@ -2225,6 +2225,8 @@ static char *fmt_single_name(struct device *dev, int *id)
|
|||
return NULL;
|
||||
|
||||
name = devm_kstrdup(dev, devname, GFP_KERNEL);
|
||||
if (!name)
|
||||
return NULL;
|
||||
|
||||
/* are we a "%s.%d" name (platform and SPI components) */
|
||||
found = strstr(name, dev->driver->name);
|
||||
|
|
Loading…
Reference in a new issue