diff options
author | Dan Carpenter <[email protected]> | 2009-12-01 13:17:41 -0800 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2009-12-01 16:32:19 -0800 |
commit | fa00e106eb6f082654d822a0946c0c86297ede2c (patch) | |
tree | f176cc90a568182419de69c555c25f9c2459a188 | |
parent | 4c4cb1b1605e50983afd7924980c9434b214599f (diff) |
drivers/rtc/rtc-pcf50633.c: fix use after free in pcf50633_rtc_probe()
"rtc" is freed and then dereferenced on the next line. This patch fixes
that.
Signed-off-by: Dan Carpenter <[email protected]>
Acked-by: Alessandro Zummo <[email protected]>
Cc: David Brownell <[email protected]>
Cc: Paul Gortmaker <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | drivers/rtc/rtc-pcf50633.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-pcf50633.c b/drivers/rtc/rtc-pcf50633.c index 33a10c47260e..4c5d5d0c4cfc 100644 --- a/drivers/rtc/rtc-pcf50633.c +++ b/drivers/rtc/rtc-pcf50633.c @@ -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, |