kernel: Fix wrong kfree

This commit is contained in:
weishu 2024-03-27 13:49:09 +08:00
parent eea2287a39
commit 5f7d4b609f

View File

@ -153,7 +153,6 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
if (IS_ERR(file)) {
pr_err("Failed to open directory: %s, err: %ld\n",
dirpath, PTR_ERR(file));
kfree(dirpath);
return FILLDIR_ACTOR_CONTINUE;
}
@ -170,7 +169,6 @@ FILLDIR_RETURN_TYPE my_actor(struct dir_context *ctx, const char *name,
*my_ctx->stop = 1;
}
}
kfree(dirpath);
}
return FILLDIR_ACTOR_CONTINUE;