summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2023-12-25 20:03:56 +0100
committerThierry Reding <treding@nvidia.com>2024-02-21 17:10:32 +0100
commit1315848f1f8a0100cb6f8a7187bc320c5d98947f (patch)
tree8abac992d4a898f35636112566784eed403ee826
parent6613476e225e090cc9aad49be7fa504e290dd33d (diff)
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
The kfree() function was called in one case by the get_filename() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. Thus return directly after a call of the function “kzalloc” failed at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/firmware/tegra/bpmp-debugfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
index bbcdd9fed3fb..4221fed70ad4 100644
--- a/drivers/firmware/tegra/bpmp-debugfs.c
+++ b/drivers/firmware/tegra/bpmp-debugfs.c
@@ -77,7 +77,7 @@ static const char *get_filename(struct tegra_bpmp *bpmp,
root_path_buf = kzalloc(root_path_buf_len, GFP_KERNEL);
if (!root_path_buf)
- goto out;
+ return NULL;
root_path = dentry_path(bpmp->debugfs_mirror, root_path_buf,
root_path_buf_len);