mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[NET]: kfree cleanup
From: Jesper Juhl <[email protected]> This is the net/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in net/. Signed-off-by: Jesper Juhl <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Acked-by: Marcel Holtmann <[email protected]> Acked-by: YOSHIFUJI Hideaki <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
This commit is contained in:
parent
ac7c98eca8
commit
a51482bde2
47 changed files with 99 additions and 191 deletions
|
|
@ -298,8 +298,7 @@ static int fw_change(struct tcf_proto *tp, unsigned long base,
|
|||
return 0;
|
||||
|
||||
errout:
|
||||
if (f)
|
||||
kfree(f);
|
||||
kfree(f);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -525,8 +525,7 @@ reinsert:
|
|||
return 0;
|
||||
|
||||
errout:
|
||||
if (f)
|
||||
kfree(f);
|
||||
kfree(f);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -555,8 +555,7 @@ insert:
|
|||
goto insert;
|
||||
|
||||
errout:
|
||||
if (f)
|
||||
kfree(f);
|
||||
kfree(f);
|
||||
errout2:
|
||||
tcf_exts_destroy(tp, &e);
|
||||
return err;
|
||||
|
|
|
|||
|
|
@ -194,8 +194,7 @@ found:
|
|||
}
|
||||
tcf_unbind_filter(tp, &r->res);
|
||||
tcf_exts_destroy(tp, &r->exts);
|
||||
if (f)
|
||||
kfree(f);
|
||||
kfree(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -442,10 +441,8 @@ static void tcindex_destroy(struct tcf_proto *tp)
|
|||
walker.skip = 0;
|
||||
walker.fn = &tcindex_destroy_element;
|
||||
tcindex_walk(tp,&walker);
|
||||
if (p->perfect)
|
||||
kfree(p->perfect);
|
||||
if (p->h)
|
||||
kfree(p->h);
|
||||
kfree(p->perfect);
|
||||
kfree(p->h);
|
||||
kfree(p);
|
||||
tp->root = NULL;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n)
|
|||
if (n->ht_down)
|
||||
n->ht_down->refcnt--;
|
||||
#ifdef CONFIG_CLS_U32_PERF
|
||||
if (n && (NULL != n->pf))
|
||||
if (n)
|
||||
kfree(n->pf);
|
||||
#endif
|
||||
kfree(n);
|
||||
|
|
@ -680,7 +680,7 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
|
|||
return 0;
|
||||
}
|
||||
#ifdef CONFIG_CLS_U32_PERF
|
||||
if (n && (NULL != n->pf))
|
||||
if (n)
|
||||
kfree(n->pf);
|
||||
#endif
|
||||
kfree(n);
|
||||
|
|
|
|||
|
|
@ -561,8 +561,7 @@ static int meta_var_change(struct meta_value *dst, struct rtattr *rta)
|
|||
|
||||
static void meta_var_destroy(struct meta_value *v)
|
||||
{
|
||||
if (v->val)
|
||||
kfree((void *) v->val);
|
||||
kfree((void *) v->val);
|
||||
}
|
||||
|
||||
static void meta_var_apply_extras(struct meta_value *v,
|
||||
|
|
|
|||
Loading…
Reference in a new issue