mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
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]>
This commit is contained in:
parent
4c4cb1b160
commit
fa00e106eb
1 changed files with 2 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in a new issue