pwm: omap-dmtimer: Potential NULL dereference on error
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 21 Dec 2015 13:13:04 +0000 (16:13 +0300)
committerThierry Reding <thierry.reding@gmail.com>
Mon, 4 Jan 2016 07:58:33 +0000 (08:58 +0100)
"omap" is NULL so we can't dereference it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-omap-dmtimer.c

index c453b33606059829395b96fa6163fc24f5fc0794..826634ec0d5c0ca26d4b09b18247ed25860dea68 100644 (file)
@@ -243,7 +243,7 @@ static int pwm_omap_dmtimer_probe(struct platform_device *pdev)
 
        omap = devm_kzalloc(&pdev->dev, sizeof(*omap), GFP_KERNEL);
        if (!omap) {
-               omap->pdata->free(dm_timer);
+               pdata->free(dm_timer);
                return -ENOMEM;
        }