提交 fa00e106 编写于 作者: D Dan Carpenter 提交者: Linus Torvalds

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: NDan Carpenter <error27@gmail.com>
Acked-by: NAlessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 4c4cb1b1
无相关合并请求
...@@ -292,8 +292,9 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev) ...@@ -292,8 +292,9 @@ static int __devinit pcf50633_rtc_probe(struct platform_device *pdev)
&pcf50633_rtc_ops, THIS_MODULE); &pcf50633_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc->rtc_dev)) { if (IS_ERR(rtc->rtc_dev)) {
int ret = PTR_ERR(rtc->rtc_dev);
kfree(rtc); kfree(rtc);
return PTR_ERR(rtc->rtc_dev); return ret;
} }
pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM, pcf50633_register_irq(rtc->pcf, PCF50633_IRQ_ALARM,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部