Skip to content

Commit

Permalink
drivers/rtc/rtc-pcf50633.c: fix use after free in pcf50633_rtc_probe()
Browse files Browse the repository at this point in the history
"rtc" is freed and then dereferenced on the next line.  This patch fixes
that.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Carpenter authored and Linus Torvalds committed Dec 2, 2009
1 parent 4c4cb1b commit fa00e10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/rtc/rtc-pcf50633.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,9 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
&pcf50633_rtc_ops, THIS_MODULE);

if (IS_ERR(rtc->rtc_dev)) {
int ret = PTR_ERR(rtc->rtc_dev);
kfree(rtc);
return PTR_ERR(rtc->rtc_dev);
return ret;
}

pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
Expand Down

0 comments on commit fa00e10

Please sign in to comment.