]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/rtc/rtc-sysfs.c
Merge tag 'for-linus-20181123' of git://git.kernel.dk/linux-block
[linux.git] / drivers / rtc / rtc-sysfs.c
index f1ff30ade5343b07ff54d05bcd82fddbc3bea0d6..9746c32eee2eb64c186e63a30f5f57ee66d1dc4c 100644 (file)
@@ -338,8 +338,8 @@ int rtc_add_groups(struct rtc_device *rtc, const struct attribute_group **grps)
 
        new_cnt = old_cnt + add_cnt + 1;
        groups = devm_kcalloc(&rtc->dev, new_cnt, sizeof(*groups), GFP_KERNEL);
-       if (IS_ERR_OR_NULL(groups))
-               return PTR_ERR(groups);
+       if (!groups)
+               return -ENOMEM;
        memcpy(groups, rtc->dev.groups, old_cnt * sizeof(*groups));
        memcpy(groups + old_cnt, grps, add_cnt * sizeof(*groups));
        groups[old_cnt + add_cnt] = NULL;