linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/3] Update for some defects
@ 2010-06-29 11:08 Yuri Ershov
  2010-06-29 11:08 ` [RFC 1/3] mac80211: Put some code under MESH macro Yuri Ershov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Yuri Ershov @ 2010-06-29 11:08 UTC (permalink / raw)
  To: johannes; +Cc: ext-yuri.kululin, linux-wireless

Hello,

These are some proposals for wireless code minor defects. 

Yuri Ershov (3):
  mac80211: Put some code under MESH macro
  nl80211: Fix memory leaks
  cfg80211: Update of regulatory request initiator handling

 net/mac80211/tx.c      |    2 ++
 net/wireless/nl80211.c |    2 ++
 net/wireless/reg.c     |    3 ++-
 3 files changed, 6 insertions(+), 1 deletions(-)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [RFC 1/3] mac80211: Put some code under MESH macro
  2010-06-29 11:08 [RFC 0/3] Update for some defects Yuri Ershov
@ 2010-06-29 11:08 ` Yuri Ershov
  2010-06-29 11:08 ` [RFC 2/3] nl80211: Fix memory leaks Yuri Ershov
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Yuri Ershov @ 2010-06-29 11:08 UTC (permalink / raw)
  To: johannes; +Cc: ext-yuri.kululin, linux-wireless

In the function ieee80211_subif_start_xmit the logic related with
meshdrlen is under CONFIG_MAC80211_MESH macro, but in one place it isn't.
This is some update for this

Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
---
---
 net/mac80211/tx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 698d471..007b76a 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1942,11 +1942,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
 		h_pos += encaps_len;
 	}
 
+#ifdef CONFIG_MAC80211_MESH
 	if (meshhdrlen > 0) {
 		memcpy(skb_push(skb, meshhdrlen), &mesh_hdr, meshhdrlen);
 		nh_pos += meshhdrlen;
 		h_pos += meshhdrlen;
 	}
+#endif
 
 	if (ieee80211_is_data_qos(fc)) {
 		__le16 *qos_control;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 2/3] nl80211: Fix memory leaks
  2010-06-29 11:08 [RFC 0/3] Update for some defects Yuri Ershov
  2010-06-29 11:08 ` [RFC 1/3] mac80211: Put some code under MESH macro Yuri Ershov
@ 2010-06-29 11:08 ` Yuri Ershov
  2010-06-29 11:08 ` [RFC 3/3] cfg80211: Update of regulatory request initiator handling Yuri Ershov
  2010-06-29 13:48 ` [RFC 0/3] Update for some defects John W. Linville
  3 siblings, 0 replies; 5+ messages in thread
From: Yuri Ershov @ 2010-06-29 11:08 UTC (permalink / raw)
  To: johannes; +Cc: ext-yuri.kululin, linux-wireless

In case of errors during message composing msg should be freed after canceling.

Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
---
 net/wireless/nl80211.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index a999fc1..c6bff6b 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2769,6 +2769,7 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
 
  nla_put_failure:
 	genlmsg_cancel(msg, hdr);
+	nlmsg_free(msg);
 	err = -EMSGSIZE;
  out:
 	/* Cleanup */
@@ -2960,6 +2961,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info)
 
 nla_put_failure:
 	genlmsg_cancel(msg, hdr);
+	nlmsg_free(msg);
 	err = -EMSGSIZE;
 out:
 	mutex_unlock(&cfg80211_mutex);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [RFC 3/3] cfg80211: Update of regulatory request initiator handling
  2010-06-29 11:08 [RFC 0/3] Update for some defects Yuri Ershov
  2010-06-29 11:08 ` [RFC 1/3] mac80211: Put some code under MESH macro Yuri Ershov
  2010-06-29 11:08 ` [RFC 2/3] nl80211: Fix memory leaks Yuri Ershov
@ 2010-06-29 11:08 ` Yuri Ershov
  2010-06-29 13:48 ` [RFC 0/3] Update for some defects John W. Linville
  3 siblings, 0 replies; 5+ messages in thread
From: Yuri Ershov @ 2010-06-29 11:08 UTC (permalink / raw)
  To: johannes; +Cc: ext-yuri.kululin, linux-wireless

In some cases there could be possible dereferencing freed pointer. The
update is intended to avoid this issue.

Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
---
 net/wireless/reg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 1ac2bdd..9ee2be9 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -1831,6 +1831,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
 {
 	int r = 0;
 	struct wiphy *wiphy = NULL;
+	enum nl80211_reg_initiator initiator = reg_request->initiator;
 
 	BUG_ON(!reg_request->alpha2);
 
@@ -1850,7 +1851,7 @@ static void reg_process_hint(struct regulatory_request *reg_request)
 	/* This is required so that the orig_* parameters are saved */
 	if (r == -EALREADY && wiphy &&
 	    wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
-		wiphy_update_regulatory(wiphy, reg_request->initiator);
+		wiphy_update_regulatory(wiphy, initiator);
 out:
 	mutex_unlock(&reg_mutex);
 	mutex_unlock(&cfg80211_mutex);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [RFC 0/3] Update for some defects
  2010-06-29 11:08 [RFC 0/3] Update for some defects Yuri Ershov
                   ` (2 preceding siblings ...)
  2010-06-29 11:08 ` [RFC 3/3] cfg80211: Update of regulatory request initiator handling Yuri Ershov
@ 2010-06-29 13:48 ` John W. Linville
  3 siblings, 0 replies; 5+ messages in thread
From: John W. Linville @ 2010-06-29 13:48 UTC (permalink / raw)
  To: Yuri Ershov; +Cc: johannes, ext-yuri.kululin, linux-wireless

On Tue, Jun 29, 2010 at 03:08:05PM +0400, Yuri Ershov wrote:

> Yuri Ershov (3):
>   mac80211: Put some code under MESH macro
>   nl80211: Fix memory leaks
>   cfg80211: Update of regulatory request initiator handling

These all seem fine to me.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-06-29 14:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-29 11:08 [RFC 0/3] Update for some defects Yuri Ershov
2010-06-29 11:08 ` [RFC 1/3] mac80211: Put some code under MESH macro Yuri Ershov
2010-06-29 11:08 ` [RFC 2/3] nl80211: Fix memory leaks Yuri Ershov
2010-06-29 11:08 ` [RFC 3/3] cfg80211: Update of regulatory request initiator handling Yuri Ershov
2010-06-29 13:48 ` [RFC 0/3] Update for some defects John W. Linville

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).