oh, sorry, this patch need improving (got --> goto)

  and I should compile, install, running in normal condition, and be
sure of no additional issues occur at least.


On 2013年04月12日 12:43, Chen Gang 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.
> 
> Signed-off-by: Chen Gang <gang.c...@asianux.com>
> ---
>  kernel/audit_tree.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
> index 642a89c..3729d49 100644
> --- a/kernel/audit_tree.c
> +++ b/kernel/audit_tree.c
> @@ -694,13 +694,15 @@ int audit_add_tree_rule(struct audit_krule *rule)
>               spin_unlock(&hash_lock);
>       } else {
>               trim_marked(tree);
> +             put_tree(tree);
>               goto Err;
>       }
>  
>       mutex_lock(&audit_filter_mutex);
>       if (list_empty(&rule->rlist)) {
>               put_tree(tree);
> -             return -ENOENT;
> +             err = -ENOENT;
> +             got Err1;
>       }
>       rule->tree = tree;
>       put_tree(tree);
> @@ -708,6 +710,7 @@ int audit_add_tree_rule(struct audit_krule *rule)
>       return 0;
>  Err:
>       mutex_lock(&audit_filter_mutex);
> +Err1:
>       list_del_init(&tree->list);
>       list_del_init(&tree->rules);
>       put_tree(tree);
> 


-- 
Chen Gang

Asianux Corporation
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to