[SCHED]: Use kmemdup & kzalloc where appropriate
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
This commit is contained in:
committed by
David S. Miller
parent
b3ab09f9e1
commit
c7b1b24978
@@ -217,7 +217,7 @@ replay:
|
||||
/* Create new proto tcf */
|
||||
|
||||
err = -ENOBUFS;
|
||||
if ((tp = kmalloc(sizeof(*tp), GFP_KERNEL)) == NULL)
|
||||
if ((tp = kzalloc(sizeof(*tp), GFP_KERNEL)) == NULL)
|
||||
goto errout;
|
||||
err = -EINVAL;
|
||||
tp_ops = tcf_proto_lookup_ops(tca[TCA_KIND-1]);
|
||||
@@ -247,7 +247,6 @@ replay:
|
||||
kfree(tp);
|
||||
goto errout;
|
||||
}
|
||||
memset(tp, 0, sizeof(*tp));
|
||||
tp->ops = tp_ops;
|
||||
tp->protocol = protocol;
|
||||
tp->prio = nprio ? : tcf_auto_prio(*back);
|
||||
|
Reference in New Issue
Block a user