diff options
author | Thomas Graf <tgraf@suug.ch> | 2006-11-10 17:10:15 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:22:11 -0500 |
commit | 339bf98ffc6a8d8eb16fc532ac57ffbced2f8a68 (patch) | |
tree | 499ad948863d2753ca10283dcf006ad28954538e /net/netlabel/netlabel_mgmt.c | |
parent | a94f723d595ee085f81b1788d18e031af7eeba91 (diff) |
[NETLINK]: Do precise netlink message allocations where possible
Account for the netlink message header size directly in nlmsg_new()
instead of relying on the caller calculate it correctly.
Replaces error handling of message construction functions when
constructing notifications with bug traps since a failure implies
a bug in calculating the size of the skb.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Paul Moore <paul.moore@hp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netlabel/netlabel_mgmt.c')
-rw-r--r-- | net/netlabel/netlabel_mgmt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c index 53c9079ad2c3..c529622ff0b7 100644 --- a/net/netlabel/netlabel_mgmt.c +++ b/net/netlabel/netlabel_mgmt.c | |||
@@ -356,7 +356,7 @@ static int netlbl_mgmt_listdef(struct sk_buff *skb, struct genl_info *info) | |||
356 | void *data; | 356 | void *data; |
357 | struct netlbl_dom_map *entry; | 357 | struct netlbl_dom_map *entry; |
358 | 358 | ||
359 | ans_skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 359 | ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
360 | if (ans_skb == NULL) | 360 | if (ans_skb == NULL) |
361 | return -ENOMEM; | 361 | return -ENOMEM; |
362 | data = netlbl_netlink_hdr_put(ans_skb, | 362 | data = netlbl_netlink_hdr_put(ans_skb, |
@@ -492,7 +492,7 @@ static int netlbl_mgmt_version(struct sk_buff *skb, struct genl_info *info) | |||
492 | struct sk_buff *ans_skb = NULL; | 492 | struct sk_buff *ans_skb = NULL; |
493 | void *data; | 493 | void *data; |
494 | 494 | ||
495 | ans_skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 495 | ans_skb = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
496 | if (ans_skb == NULL) | 496 | if (ans_skb == NULL) |
497 | return -ENOMEM; | 497 | return -ENOMEM; |
498 | data = netlbl_netlink_hdr_put(ans_skb, | 498 | data = netlbl_netlink_hdr_put(ans_skb, |