]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit2766f168b7c81d8c9887cac7e9383de2c2b47af3
tree51f02c30055d391c7d20ca97e5c59fc4b55d12dd
parentb42b1df302af48f00d03e1ef3ab8c2334ff1df0c
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: cea62c465b69 ("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