On 14.09.2012 08:52, Dan Carpenter wrote:
We should free "node->loaded_info" on this error path. We'd never care
in real life but it makes the static checkers happy.
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
---
v2: some style changes.
Signed-off-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
Thanks for sending this patch.
Andrew, since there is no tree for gcov patches, could you queue this
for upstream inclusion?
Regards,
Peter Oberparleiter
---
We should free "node->loaded_info" on this error path. We'd never care
in real life but it makes the static checkers happy.
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Peter Oberparleiter <oberpar@xxxxxxxxxxxxxxxxxx>
---
v2: some style changes.
diff --git a/kernel/gcov/fs.c b/kernel/gcov/fs.c
index 9bd0934..7ba47f7 100644
--- a/kernel/gcov/fs.c
+++ b/kernel/gcov/fs.c
@@ -451,8 +451,7 @@ static struct gcov_node *new_node(struct gcov_node
*parent,
node->dentry = debugfs_create_dir(node->name, parent->dentry);
if (!node->dentry) {
pr_warning("could not create file\n");
- kfree(node);
- return NULL;
+ goto err_info;
}
if (info)
add_links(node, parent->dentry);
@@ -461,6 +460,8 @@ static struct gcov_node *new_node(struct gcov_node
*parent,
return node;
+err_info:
+ kfree(node->loaded_info);
err_nomem:
kfree(node);
pr_warning("out of memory\n");
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html