]> git.ipfire.org Git - thirdparty/kernel/linux.git/blobdiff - lib/test_objagg.c
test_objagg: Uninitialized variable in error handling
[thirdparty/kernel/linux.git] / lib / test_objagg.c
index 3dd45777b13c922fc687fb8c787a37c4a2461d42..72c1abfa154dc6de0206ee000807641f2a59d617 100644 (file)
@@ -745,8 +745,10 @@ static int check_expect_stats(struct objagg *objagg,
        int err;
 
        stats = objagg_stats_get(objagg);
-       if (IS_ERR(stats))
+       if (IS_ERR(stats)) {
+               *errmsg = "objagg_stats_get() failed.";
                return PTR_ERR(stats);
+       }
        err = __check_expect_stats(stats, expect_stats, errmsg);
        objagg_stats_put(stats);
        return err;
@@ -786,7 +788,6 @@ static int test_delta_action_item(struct world *world,
        if (err)
                goto errout;
 
-       errmsg = NULL;
        err = check_expect_stats(objagg, &action_item->expect_stats, &errmsg);
        if (err) {
                pr_err("Key %u: Stats: %s\n", action_item->key_id, errmsg);