Skip to content

Commit

Permalink
leds: renesas: fix error handling
Browse files Browse the repository at this point in the history
bfe4c04 "leds: convert Renesas TPU LED driver to devm_kzalloc() and
cleanup error exit path" introduced a possible case in which r_tpu_probe
calls iounmap on a wild pointer. This changes the one case that was
missed in the same way as the other error paths.

Without this patch, building kota2_defconfig results in:

drivers/leds/leds-renesas-tpu.c: In function 'r_tpu_probe':
drivers/leds/leds-renesas-tpu.c:246:6: warning: 'ret' may be used uninitialized in this function [-Wuninitialized]
drivers/leds/leds-renesas-tpu.c:308:17: warning: 'p' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Magnus Damm <damm@opensource.se>
Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
  • Loading branch information
Arnd Bergmann authored and Bryan Wu committed Aug 13, 2012
1 parent 86e99d2 commit 4a5a418
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/leds/leds-renesas-tpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ static int __devinit r_tpu_probe(struct platform_device *pdev)

if (!cfg) {
dev_err(&pdev->dev, "missing platform data\n");
goto err0;
return -ENODEV;
}

p = devm_kzalloc(&pdev->dev, sizeof(*p), GFP_KERNEL);
Expand Down

0 comments on commit 4a5a418

Please sign in to comment.