diff options
Diffstat (limited to 'net/decnet/dn_rules.c')
-rw-r--r-- | net/decnet/dn_rules.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/net/decnet/dn_rules.c b/net/decnet/dn_rules.c index 06e785fe5757..6986be754ef2 100644 --- a/net/decnet/dn_rules.c +++ b/net/decnet/dn_rules.c | |||
@@ -151,10 +151,9 @@ int dn_fib_rtm_newrule(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
151 | } | 151 | } |
152 | } | 152 | } |
153 | 153 | ||
154 | new_r = kmalloc(sizeof(*new_r), GFP_KERNEL); | 154 | new_r = kzalloc(sizeof(*new_r), GFP_KERNEL); |
155 | if (!new_r) | 155 | if (!new_r) |
156 | return -ENOMEM; | 156 | return -ENOMEM; |
157 | memset(new_r, 0, sizeof(*new_r)); | ||
158 | 157 | ||
159 | if (rta[RTA_SRC-1]) | 158 | if (rta[RTA_SRC-1]) |
160 | memcpy(&new_r->r_src, RTA_DATA(rta[RTA_SRC-1]), 2); | 159 | memcpy(&new_r->r_src, RTA_DATA(rta[RTA_SRC-1]), 2); |
@@ -399,9 +398,10 @@ int dn_fib_dump_rules(struct sk_buff *skb, struct netlink_callback *cb) | |||
399 | rcu_read_lock(); | 398 | rcu_read_lock(); |
400 | hlist_for_each_entry(r, node, &dn_fib_rules, r_hlist) { | 399 | hlist_for_each_entry(r, node, &dn_fib_rules, r_hlist) { |
401 | if (idx < s_idx) | 400 | if (idx < s_idx) |
402 | continue; | 401 | goto next; |
403 | if (dn_fib_fill_rule(skb, r, cb, NLM_F_MULTI) < 0) | 402 | if (dn_fib_fill_rule(skb, r, cb, NLM_F_MULTI) < 0) |
404 | break; | 403 | break; |
404 | next: | ||
405 | idx++; | 405 | idx++; |
406 | } | 406 | } |
407 | rcu_read_unlock(); | 407 | rcu_read_unlock(); |