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/wireless/nl80211.c | |
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/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7ae54b82291f..cbdc0fd67a14 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -7210,7 +7210,7 @@ void nl80211_send_scan_start(struct cfg80211_registered_device *rdev, | |||
7210 | { | 7210 | { |
7211 | struct sk_buff *msg; | 7211 | struct sk_buff *msg; |
7212 | 7212 | ||
7213 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 7213 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
7214 | if (!msg) | 7214 | if (!msg) |
7215 | return; | 7215 | return; |
7216 | 7216 | ||
@@ -7286,7 +7286,7 @@ void nl80211_send_sched_scan(struct cfg80211_registered_device *rdev, | |||
7286 | { | 7286 | { |
7287 | struct sk_buff *msg; | 7287 | struct sk_buff *msg; |
7288 | 7288 | ||
7289 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 7289 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
7290 | if (!msg) | 7290 | if (!msg) |
7291 | return; | 7291 | return; |
7292 | 7292 | ||
@@ -7502,7 +7502,7 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev, | |||
7502 | struct sk_buff *msg; | 7502 | struct sk_buff *msg; |
7503 | void *hdr; | 7503 | void *hdr; |
7504 | 7504 | ||
7505 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 7505 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
7506 | if (!msg) | 7506 | if (!msg) |
7507 | return; | 7507 | return; |
7508 | 7508 | ||
@@ -7542,7 +7542,7 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev, | |||
7542 | struct sk_buff *msg; | 7542 | struct sk_buff *msg; |
7543 | void *hdr; | 7543 | void *hdr; |
7544 | 7544 | ||
7545 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 7545 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
7546 | if (!msg) | 7546 | if (!msg) |
7547 | return; | 7547 | return; |
7548 | 7548 | ||
@@ -7580,7 +7580,7 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev, | |||
7580 | struct sk_buff *msg; | 7580 | struct sk_buff *msg; |
7581 | void *hdr; | 7581 | void *hdr; |
7582 | 7582 | ||
7583 | msg = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); | 7583 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
7584 | if (!msg) | 7584 | if (!msg) |
7585 | return; | 7585 | return; |
7586 | 7586 | ||
@@ -7842,7 +7842,7 @@ void nl80211_send_sta_event(struct cfg80211_registered_device *rdev, | |||
7842 | { | 7842 | { |
7843 | struct sk_buff *msg; | 7843 | struct sk_buff *msg; |
7844 | 7844 | ||
7845 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 7845 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
7846 | if (!msg) | 7846 | if (!msg) |
7847 | return; | 7847 | return; |
7848 | 7848 | ||
@@ -7863,7 +7863,7 @@ void nl80211_send_sta_del_event(struct cfg80211_registered_device *rdev, | |||
7863 | struct sk_buff *msg; | 7863 | struct sk_buff *msg; |
7864 | void *hdr; | 7864 | void *hdr; |
7865 | 7865 | ||
7866 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 7866 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
7867 | if (!msg) | 7867 | if (!msg) |
7868 | return; | 7868 | return; |
7869 | 7869 | ||
@@ -8026,7 +8026,7 @@ nl80211_send_cqm_rssi_notify(struct cfg80211_registered_device *rdev, | |||
8026 | struct nlattr *pinfoattr; | 8026 | struct nlattr *pinfoattr; |
8027 | void *hdr; | 8027 | void *hdr; |
8028 | 8028 | ||
8029 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 8029 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
8030 | if (!msg) | 8030 | if (!msg) |
8031 | return; | 8031 | return; |
8032 | 8032 | ||
@@ -8069,7 +8069,7 @@ void nl80211_gtk_rekey_notify(struct cfg80211_registered_device *rdev, | |||
8069 | struct nlattr *rekey_attr; | 8069 | struct nlattr *rekey_attr; |
8070 | void *hdr; | 8070 | void *hdr; |
8071 | 8071 | ||
8072 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 8072 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
8073 | if (!msg) | 8073 | if (!msg) |
8074 | return; | 8074 | return; |
8075 | 8075 | ||
@@ -8113,7 +8113,7 @@ void nl80211_pmksa_candidate_notify(struct cfg80211_registered_device *rdev, | |||
8113 | struct nlattr *attr; | 8113 | struct nlattr *attr; |
8114 | void *hdr; | 8114 | void *hdr; |
8115 | 8115 | ||
8116 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 8116 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
8117 | if (!msg) | 8117 | if (!msg) |
8118 | return; | 8118 | return; |
8119 | 8119 | ||
@@ -8157,7 +8157,7 @@ void nl80211_ch_switch_notify(struct cfg80211_registered_device *rdev, | |||
8157 | struct sk_buff *msg; | 8157 | struct sk_buff *msg; |
8158 | void *hdr; | 8158 | void *hdr; |
8159 | 8159 | ||
8160 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 8160 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
8161 | if (!msg) | 8161 | if (!msg) |
8162 | return; | 8162 | return; |
8163 | 8163 | ||
@@ -8192,7 +8192,7 @@ nl80211_send_cqm_pktloss_notify(struct cfg80211_registered_device *rdev, | |||
8192 | struct nlattr *pinfoattr; | 8192 | struct nlattr *pinfoattr; |
8193 | void *hdr; | 8193 | void *hdr; |
8194 | 8194 | ||
8195 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 8195 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
8196 | if (!msg) | 8196 | if (!msg) |
8197 | return; | 8197 | return; |
8198 | 8198 | ||
@@ -8236,7 +8236,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
8236 | void *hdr; | 8236 | void *hdr; |
8237 | int err; | 8237 | int err; |
8238 | 8238 | ||
8239 | msg = nlmsg_new(NLMSG_GOODSIZE, gfp); | 8239 | msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); |
8240 | if (!msg) | 8240 | if (!msg) |
8241 | return; | 8241 | return; |
8242 | 8242 | ||