diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2023-12-25 22:03:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-04-13 14:07:31 +0300 |
commit | 5dc5f8c705c3bf7cebf982497042b516d7d8f621 (patch) | |
tree | 2c8c747b637a0181b38a04ed4457d041043127a4 /drivers/firmware | |
parent | 1b2b26595bb09febf14c5444c873ac4ec90a5a77 (diff) | |
download | linux-5dc5f8c705c3bf7cebf982497042b516d7d8f621.tar.xz |
firmware: tegra: bpmp: Return directly after a failed kzalloc() in get_filename()
[ Upstream commit 1315848f1f8a0100cb6f8a7187bc320c5d98947f ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/firmware')
-rw-r--r-- | drivers/firmware/tegra/bpmp-debugfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c index 6dfe3d34109e..b20d04950d99 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); |