rtc: sysfs: fix NULL check in rtc_add_groups()
mainline inclusion from mainline-4.20-rc1 commit 777d8ae5 category: bugfix bugzilla: 6616 CVE: NA ------------------------------------------------- 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: a0a1a1ba ("rtc: sysfs: facilitate attribute add to rtc device") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: NZhang Dianfang <zhangdianfang@huawei.com> Reviewed-by: NHanjun Guo <guohanjun@huawei.com> Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Showing
想要评论请 注册 或 登录