netlink: Fix bugs in nlmsg_end() conversions.
Commit 053c095a82
("netlink: make nlmsg_end() and genlmsg_end()
void") didn't catch all of the cases where callers were breaking out
on the return value being equal to zero, which they no longer should
when zero means success.
Fix all such cases.
Reported-by: Marcel Holtmann <marcel@holtmann.org>
Reported-by: Scott Feldman <sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
@@ -2128,7 +2128,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
|
||||
if (neightbl_fill_info(skb, tbl, NETLINK_CB(cb->skb).portid,
|
||||
cb->nlh->nlmsg_seq, RTM_NEWNEIGHTBL,
|
||||
NLM_F_MULTI) <= 0)
|
||||
NLM_F_MULTI) < 0)
|
||||
break;
|
||||
|
||||
nidx = 0;
|
||||
@@ -2144,7 +2144,7 @@ static int neightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb)
|
||||
NETLINK_CB(cb->skb).portid,
|
||||
cb->nlh->nlmsg_seq,
|
||||
RTM_NEWNEIGHTBL,
|
||||
NLM_F_MULTI) <= 0)
|
||||
NLM_F_MULTI) < 0)
|
||||
goto out;
|
||||
next:
|
||||
nidx++;
|
||||
@@ -2274,7 +2274,7 @@ static int neigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
|
||||
if (neigh_fill_info(skb, n, NETLINK_CB(cb->skb).portid,
|
||||
cb->nlh->nlmsg_seq,
|
||||
RTM_NEWNEIGH,
|
||||
NLM_F_MULTI) <= 0) {
|
||||
NLM_F_MULTI) < 0) {
|
||||
rc = -1;
|
||||
goto out;
|
||||
}
|
||||
@@ -2311,7 +2311,7 @@ static int pneigh_dump_table(struct neigh_table *tbl, struct sk_buff *skb,
|
||||
if (pneigh_fill_info(skb, n, NETLINK_CB(cb->skb).portid,
|
||||
cb->nlh->nlmsg_seq,
|
||||
RTM_NEWNEIGH,
|
||||
NLM_F_MULTI, tbl) <= 0) {
|
||||
NLM_F_MULTI, tbl) < 0) {
|
||||
read_unlock_bh(&tbl->lock);
|
||||
rc = -1;
|
||||
goto out;
|
||||
|
Reference in New Issue
Block a user