* [PATCH] nl80211: remove unnecessary cfg80211_ssid pointer in nl80211_trigger_scan
@ 2011-05-18 8:21 Luciano Coelho
2011-05-18 8:34 ` Luciano Coelho
0 siblings, 1 reply; 2+ messages in thread
From: Luciano Coelho @ 2011-05-18 8:21 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, johannes
The struct cfg80211_ssid *ssid variable was only used to figure out
the size of the struct when allocating memory. This is not necessary,
because sizeof(*request->ssids) can be used instead.
Signed-off-by: Luciano Coelho <coelho@ti.com>
---
net/wireless/nl80211.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index d967073..ebcfcf2 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -3300,7 +3300,6 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
struct cfg80211_registered_device *rdev = info->user_ptr[0];
struct net_device *dev = info->user_ptr[1];
struct cfg80211_scan_request *request;
- struct cfg80211_ssid *ssid;
struct ieee80211_channel *channel;
struct nlattr *attr;
struct wiphy *wiphy;
@@ -3348,7 +3347,7 @@ static int nl80211_trigger_scan(struct sk_buff *skb, struct genl_info *info)
return -EINVAL;
request = kzalloc(sizeof(*request)
- + sizeof(*ssid) * n_ssids
+ + sizeof(*request->ssids) * n_ssids
+ sizeof(channel) * n_channels
+ ie_len, GFP_KERNEL);
if (!request)
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] nl80211: remove unnecessary cfg80211_ssid pointer in nl80211_trigger_scan
2011-05-18 8:21 [PATCH] nl80211: remove unnecessary cfg80211_ssid pointer in nl80211_trigger_scan Luciano Coelho
@ 2011-05-18 8:34 ` Luciano Coelho
0 siblings, 0 replies; 2+ messages in thread
From: Luciano Coelho @ 2011-05-18 8:34 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, johannes
On Wed, 2011-05-18 at 11:21 +0300, Luciano Coelho wrote:
> The struct cfg80211_ssid *ssid variable was only used to figure out
> the size of the struct when allocating memory. This is not necessary,
> because sizeof(*request->ssids) can be used instead.
>
> Signed-off-by: Luciano Coelho <coelho@ti.com>
> ---
Please ignore this patch, I'll send another one with a couple more
similar clean-ups instead.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-05-18 8:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-18 8:21 [PATCH] nl80211: remove unnecessary cfg80211_ssid pointer in nl80211_trigger_scan Luciano Coelho
2011-05-18 8:34 ` Luciano Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox