diff options
author | Thomas Graf <tgraf@suug.ch> | 2012-06-27 23:57:45 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-06-28 20:56:43 -0400 |
commit | 58050fce3530939372e6c2f4b4beb76fcb4caa65 (patch) | |
tree | ee2b85eda9973fed36102dad66f583e43a4a6cab /net/ieee802154 | |
parent | 9f10d3f6f966ef6f6a8d025a4b1d341923d04607 (diff) |
net: Use NLMSG_DEFAULT_SIZE in combination with nlmsg_new()
Using NLMSG_GOODSIZE results in multiple pages being used as
nlmsg_new() will automatically add the size of the netlink
header to the payload thus exceeding the page limit.
NLMSG_DEFAULT_SIZE takes this into account.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
Cc: Jiri Pirko <jpirko@redhat.com>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Sergey Lapin <slapin@ossfans.org>
Cc: Johannes Berg <johannes@sipsolutions.net>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Reviewed-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ieee802154')
-rw-r--r-- | net/ieee802154/netlink.c | 4 | ||||
-rw-r--r-- | net/ieee802154/nl-mac.c | 2 | ||||
-rw-r--r-- | net/ieee802154/nl-phy.c | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/net/ieee802154/netlink.c b/net/ieee802154/netlink.c index c8097ae2482f..97351e1d07a4 100644 --- a/net/ieee802154/netlink.c +++ b/net/ieee802154/netlink.c | |||
@@ -44,7 +44,7 @@ struct genl_family nl802154_family = { | |||
44 | struct sk_buff *ieee802154_nl_create(int flags, u8 req) | 44 | struct sk_buff *ieee802154_nl_create(int flags, u8 req) |
45 | { | 45 | { |
46 | void *hdr; | 46 | void *hdr; |
47 | struct sk_buff *msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); | 47 | struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
48 | unsigned long f; | 48 | unsigned long f; |
49 | 49 | ||
50 | if (!msg) | 50 | if (!msg) |
@@ -80,7 +80,7 @@ struct sk_buff *ieee802154_nl_new_reply(struct genl_info *info, | |||
80 | int flags, u8 req) | 80 | int flags, u8 req) |
81 | { | 81 | { |
82 | void *hdr; | 82 | void *hdr; |
83 | struct sk_buff *msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); | 83 | struct sk_buff *msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
84 | 84 | ||
85 | if (!msg) | 85 | if (!msg) |
86 | return NULL; | 86 | return NULL; |
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c index ca92587720f4..1e9917124e75 100644 --- a/net/ieee802154/nl-mac.c +++ b/net/ieee802154/nl-mac.c | |||
@@ -530,7 +530,7 @@ static int ieee802154_list_iface(struct sk_buff *skb, | |||
530 | if (!dev) | 530 | if (!dev) |
531 | return -ENODEV; | 531 | return -ENODEV; |
532 | 532 | ||
533 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 533 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
534 | if (!msg) | 534 | if (!msg) |
535 | goto out_dev; | 535 | goto out_dev; |
536 | 536 | ||
diff --git a/net/ieee802154/nl-phy.c b/net/ieee802154/nl-phy.c index eed291626da6..d54be34cca94 100644 --- a/net/ieee802154/nl-phy.c +++ b/net/ieee802154/nl-phy.c | |||
@@ -101,7 +101,7 @@ static int ieee802154_list_phy(struct sk_buff *skb, | |||
101 | if (!phy) | 101 | if (!phy) |
102 | return -ENODEV; | 102 | return -ENODEV; |
103 | 103 | ||
104 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 104 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
105 | if (!msg) | 105 | if (!msg) |
106 | goto out_dev; | 106 | goto out_dev; |
107 | 107 | ||