]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - drivers/rtc/sysfs.c
rtc: sysfs: fix NULL check in rtc_add_groups()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 27 Aug 2018 09:22:34 +0000 (12:22 +0300)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 27 Aug 2018 21:03:34 +0000 (23:03 +0200)
commit777d8ae56da18fb6440acd941edb3597c1b02bf0
tree51f02c30055d391c7d20ca97e5c59fc4b55d12dd
parent725e0e15f84bb30e83fad8fa4b4dd1f335506172
rtc: sysfs: fix NULL check in rtc_add_groups()

devm_kcalloc() returns NULL, it never returns error pointers.  In the
current code we would return PTR_ERR(NULL) which is success, instead of
returning the -ENOMEM error code.

Fixes: a0a1a1ba3032 ("rtc: sysfs: facilitate attribute add to rtc device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-sysfs.c