Skip to content

Commit

Permalink
usb/s3c-hsudc: fix error path
Browse files Browse the repository at this point in the history
I doubt the clock is optional. In case it is it should not return with
an error code because we leak everything.

Cc: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Sebastian Andrzej Siewior authored and Greg Kroah-Hartman committed Jun 6, 2011
1 parent a6207b1 commit 6bc1295
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/gadget/s3c-hsudc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
hsudc->uclk = clk_get(&pdev->dev, "usb-device");
if (IS_ERR(hsudc->uclk)) {
dev_err(dev, "failed to find usb-device clock source\n");
return PTR_ERR(hsudc->uclk);
ret = PTR_ERR(hsudc->uclk);
goto err_clk;
}
clk_enable(hsudc->uclk);

Expand All @@ -1311,7 +1312,8 @@ static int s3c_hsudc_probe(struct platform_device *pdev)
disable_irq(hsudc->irq);
local_irq_enable();
return 0;

err_clk:
free_irq(hsudc->irq, hsudc);
err_irq:
iounmap(hsudc->regs);

Expand Down

0 comments on commit 6bc1295

Please sign in to comment.