Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <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>

authored by

Dan Carpenter and committed by
Linus Torvalds
fa00e106 4c4cb1b1

+2 -1
+2 -1
drivers/rtc/rtc-pcf50633.c
··· 292 292 &pcf50633_rtc_ops, THIS_MODULE); 293 293 294 294 if (IS_ERR(rtc->rtc_dev)) { 295 + int ret = PTR_ERR(rtc->rtc_dev); 295 296 kfree(rtc); 296 - return PTR_ERR(rtc->rtc_dev); 297 + return ret; 297 298 } 298 299 299 300 pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,