lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5056D820.1060302@linux.vnet.ibm.com>
Date:	Mon, 17 Sep 2012 09:58:24 +0200
From:	Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
To:	Dan Carpenter <dan.carpenter@...cle.com>
CC:	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [patch v2] gcov: add a kfree() on error to new_node()

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@...cle.com>
> ---
> v2: some style changes.
>

Signed-off-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>

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@...cle.com>
Signed-off-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@...ux.vnet.ibm.com>
---
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 linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ