public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Chen Gang F T <chen.gang.flying.transformer@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Chen Gang <gang.chen@asianux.com>, Eric Paris <eparis@redhat.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures
Date: Thu, 18 Apr 2013 09:19:36 +0800	[thread overview]
Message-ID: <516F4A28.2050806@gmail.com> (raw)
In-Reply-To: <20130417130739.03fb8d9ccb908afc0a1db861@linux-foundation.org>

On 2013年04月18日 04:07, Andrew Morton wrote:
> On Wed, 17 Apr 2013 12:04:02 +0800 Chen Gang <gang.chen@asianux.com> wrote:
> 
>> >   since "normally audit_add_tree_rule() will free it on failure",
>> >   need free it completely, when failure occures.
>> > 
>> >     need additional put_tree before return, since get_tree was called.
>> >     always need goto error processing area for list_del_init.
> Isn't that get_tree() in audit_add_tree_rule() simply unneeded?  In
> other words, is this patch correct:
> 

  excuse me:
    I am not quite familiar with it, and also have to do another things.
    so I have to spend additional time resource to make sure about it.

  is it ok ?
    I should make sure about it within this week (2013-04-21)
    I should finish related test (if need), within next week (2013-4-28)

  if have additional suggestions or completions, please reply.
    (if no reply, I will follow the time point above)

  thanks.

gchen.


> --- a/kernel/audit_tree.c~a
> +++ a/kernel/audit_tree.c
> @@ -682,7 +682,6 @@ int audit_add_tree_rule(struct audit_kru
>  		goto Err;
>  	}
>  
> -	get_tree(tree);
>  	err = iterate_mounts(tag_mount, tree, mnt);
>  	drop_collected_mounts(mnt);
>  
> @@ -703,7 +702,6 @@ int audit_add_tree_rule(struct audit_kru
>  		return -ENOENT;
>  	}
>  	rule->tree = tree;
> -	put_tree(tree);
>  
>  	return 0;
>  Err:
> _
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


-- 
Chen Gang

Flying Transformer

  reply	other threads:[~2013-04-18  1:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12  4:43 [PATCH] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures Chen Gang
2013-04-12  4:50 ` [PATCH] kernel: audit_watch: resource management: better reset to NULL Chen Gang
2013-04-12  8:18   ` Chen Gang
2013-04-12  8:56     ` [PATCH] kernel: auditfilter: resource management, need process tree when audit_add_watch failed in audit_add_rule Chen Gang
2013-04-17  4:26       ` Chen Gang
2013-04-16  7:35 ` [PATCH] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures Chen Gang
2013-04-17  4:04   ` [PATCH v2] " Chen Gang
2013-04-17 20:07     ` Andrew Morton
2013-04-18  1:19       ` Chen Gang F T [this message]
2013-04-20  7:31         ` Chen Gang
2013-04-23  3:51           ` Chen Gang
  -- strict thread matches above, loose matches on Subject: below --
2013-04-19  9:39 [PATCH] kernel/audit_tree.c: tree will memory leak when failure occurs for audit_trim_trees() Chen Gang
2013-04-22 23:04 ` Andrew Morton
2013-05-09 12:53   ` [PATCH v2] kernel: audit_tree: resource management: need put_tree and goto Err when failure occures Chen Gang
2013-05-09 20:11     ` Andrew Morton
2013-05-10  2:08       ` Chen Gang
2013-05-10  9:50         ` Chen Gang
2013-05-10 11:29           ` Chen Gang
2013-05-13  2:54             ` Chen Gang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=516F4A28.2050806@gmail.com \
    --to=chen.gang.flying.transformer@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=eparis@redhat.com \
    --cc=gang.chen@asianux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox