]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
coresight: Potential uninitialized variable in probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 20 Jun 2019 22:12:37 +0000 (16:12 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Jul 2019 19:15:33 +0000 (21:15 +0200)
The "drvdata->atclk" clock is optional, but if it gets set to an error
pointer then we're accidentally return an uninitialized variable instead
of success.

Fixes: 78e6427b4e7b ("coresight: funnel: Support static funnel")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: stable <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20190620221237.3536-6-mathieu.poirier@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwtracing/coresight/coresight-funnel.c

index 5867fcb4503ba549c95e7cd060bf7c2ea116a969..fa97cb9ab4f9dc6ba8e980fbcace0294e3a309f8 100644 (file)
@@ -244,6 +244,7 @@ static int funnel_probe(struct device *dev, struct resource *res)
        }
 
        pm_runtime_put(dev);
+       ret = 0;
 
 out_disable_clk:
        if (ret && !IS_ERR_OR_NULL(drvdata->atclk))