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/nfc | |
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/nfc')
-rw-r--r-- | net/nfc/netlink.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c index 03c31db38f12..f4f07f9b61c0 100644 --- a/net/nfc/netlink.c +++ b/net/nfc/netlink.c | |||
@@ -167,7 +167,7 @@ int nfc_genl_targets_found(struct nfc_dev *dev) | |||
167 | 167 | ||
168 | dev->genl_data.poll_req_pid = 0; | 168 | dev->genl_data.poll_req_pid = 0; |
169 | 169 | ||
170 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); | 170 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
171 | if (!msg) | 171 | if (!msg) |
172 | return -ENOMEM; | 172 | return -ENOMEM; |
173 | 173 | ||
@@ -195,7 +195,7 @@ int nfc_genl_target_lost(struct nfc_dev *dev, u32 target_idx) | |||
195 | struct sk_buff *msg; | 195 | struct sk_buff *msg; |
196 | void *hdr; | 196 | void *hdr; |
197 | 197 | ||
198 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 198 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
199 | if (!msg) | 199 | if (!msg) |
200 | return -ENOMEM; | 200 | return -ENOMEM; |
201 | 201 | ||
@@ -226,7 +226,7 @@ int nfc_genl_tm_activated(struct nfc_dev *dev, u32 protocol) | |||
226 | struct sk_buff *msg; | 226 | struct sk_buff *msg; |
227 | void *hdr; | 227 | void *hdr; |
228 | 228 | ||
229 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 229 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
230 | if (!msg) | 230 | if (!msg) |
231 | return -ENOMEM; | 231 | return -ENOMEM; |
232 | 232 | ||
@@ -258,7 +258,7 @@ int nfc_genl_tm_deactivated(struct nfc_dev *dev) | |||
258 | struct sk_buff *msg; | 258 | struct sk_buff *msg; |
259 | void *hdr; | 259 | void *hdr; |
260 | 260 | ||
261 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 261 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
262 | if (!msg) | 262 | if (!msg) |
263 | return -ENOMEM; | 263 | return -ENOMEM; |
264 | 264 | ||
@@ -288,7 +288,7 @@ int nfc_genl_device_added(struct nfc_dev *dev) | |||
288 | struct sk_buff *msg; | 288 | struct sk_buff *msg; |
289 | void *hdr; | 289 | void *hdr; |
290 | 290 | ||
291 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 291 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
292 | if (!msg) | 292 | if (!msg) |
293 | return -ENOMEM; | 293 | return -ENOMEM; |
294 | 294 | ||
@@ -321,7 +321,7 @@ int nfc_genl_device_removed(struct nfc_dev *dev) | |||
321 | struct sk_buff *msg; | 321 | struct sk_buff *msg; |
322 | void *hdr; | 322 | void *hdr; |
323 | 323 | ||
324 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 324 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
325 | if (!msg) | 325 | if (!msg) |
326 | return -ENOMEM; | 326 | return -ENOMEM; |
327 | 327 | ||
@@ -434,7 +434,7 @@ int nfc_genl_dep_link_up_event(struct nfc_dev *dev, u32 target_idx, | |||
434 | 434 | ||
435 | pr_debug("DEP link is up\n"); | 435 | pr_debug("DEP link is up\n"); |
436 | 436 | ||
437 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); | 437 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
438 | if (!msg) | 438 | if (!msg) |
439 | return -ENOMEM; | 439 | return -ENOMEM; |
440 | 440 | ||
@@ -473,7 +473,7 @@ int nfc_genl_dep_link_down_event(struct nfc_dev *dev) | |||
473 | 473 | ||
474 | pr_debug("DEP link is down\n"); | 474 | pr_debug("DEP link is down\n"); |
475 | 475 | ||
476 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_ATOMIC); | 476 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
477 | if (!msg) | 477 | if (!msg) |
478 | return -ENOMEM; | 478 | return -ENOMEM; |
479 | 479 | ||
@@ -514,7 +514,7 @@ static int nfc_genl_get_device(struct sk_buff *skb, struct genl_info *info) | |||
514 | if (!dev) | 514 | if (!dev) |
515 | return -ENODEV; | 515 | return -ENODEV; |
516 | 516 | ||
517 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 517 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
518 | if (!msg) { | 518 | if (!msg) { |
519 | rc = -ENOMEM; | 519 | rc = -ENOMEM; |
520 | goto out_putdev; | 520 | goto out_putdev; |