Skip to contentSkip to conversation

Update for some defects

RFC In review Yuri Ershov 2 participants 5 messages Jun 29, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Update for some defects

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(-)
#1 lore raw

RFC 1/3 mac80211: Put some code under MESH macro

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

---

---
 net/mac80211/tx.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/mac80211/tx.c +2 -0
index 698d471..007b76a 100644
@@ -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;
Signature · 1 line
1.7.0.4
#2 lore raw

RFC 2/3 nl80211: Fix memory leaks

In reply to Yuri Ershov

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

---
 net/wireless/nl80211.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
net/wireless/nl80211.c +2 -0
index a999fc1..c6bff6b 100644
@@ -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);
Signature · 1 line
1.7.0.4
#3 lore raw

RFC 3/3 cfg80211: Update of regulatory request initiator handling

In reply to Yuri Ershov

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

---
 net/wireless/reg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
net/wireless/reg.c +2 -1
index 1ac2bdd..9ee2be9 100644
@@ -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);
Signature · 1 line
1.7.0.4
#4 lore raw
In reply to Yuri Ershov
Quoted 4 lines · Yuri Ershov

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

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.