Re: [PATCH] rtc: class: don't call cdev_device_del() when cdev_device_add() failed

From: Alexandre Belloni
Date: Fri Oct 15 2021 - 15:12:31 EST


On Mon, 11 Oct 2021 21:21:14 +0800, Yang Yingliang wrote:
> I got a null-ptr-deref report when doing fault injection test:
>
> general protection fault, probably for non-canonical address 0xdffffc0000000022: 0000 [#1] SMP KASAN PTI
> KASAN: null-ptr-deref in range [0x0000000000000110-0x0000000000000117]
> RIP: 0010:device_del+0x132/0xdc0
> Call Trace:
> cdev_device_del+0x1a/0x80
> devm_rtc_unregister_device+0x37/0x80
> release_nodes+0xc3/0x3b0
>
> [...]

Applied, thanks!

[1/1] rtc: class: don't call cdev_device_del() when cdev_device_add() failed
commit: 789c1093f02c436b320d78a739f9610c8271cb73

Best regards,
--
Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>