]> Git Repo - J-linux.git/commitdiff
ASoC: core: Fix Null-point-dereference in fmt_single_name()
authorKefeng Wang <[email protected]>
Mon, 24 May 2021 02:49:41 +0000 (10:49 +0800)
committerMark Brown <[email protected]>
Mon, 24 May 2021 08:49:28 +0000 (09:49 +0100)
Check the return value of devm_kstrdup() in case of
Null-point-dereference.

Fixes: 45dd9943fce0 ("ASoC: core: remove artificial component and DAI name constraint")
Cc: Dmitry Baryshkov <[email protected]>
Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Kefeng Wang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
sound/soc/soc-core.c

index 1c0904acb93564ded5d409b6d027aabc4d5d575f..a76974ccfce10663194a2ee9b9a3676f35c7a430 100644 (file)
@@ -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);
This page took 0.468532 seconds and 4 git commands to generate.