Skip to contentSkip to conversation

iw: Avoid possible memory leak for cb. cb got memory from nl_cb_alloc() but not doing free

PATCH In review Amit Khatri 2 participants 2 messages Jun 26, 2015 – Aug 13, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 iw: Avoid possible memory leak for cb. cb got memory from nl_cb_alloc() but not doing free

SGkgSm9oYW5uZXMsDQoNClN1YmplY3Q6IFtQQVRDSCAyLzRdIGl3OiBBdm9pZCBwb3NzaWJsZSBt ZW1vcnkgbGVhayBmb3IgY2IuIGNiIGdvdCBtZW1vcnkgZnJvbQ0KIG5sX2NiX2FsbG9jKCkgYnV0 IG5vdCBkb2luZyBmcmVlDQoNClNpZ25lZC1vZmYtYnk6IEFtaXQgS2hhdHJpIDxhbWl0LmtoYXRy aUBzYW1zdW5nLmNvbT4NClNpZ25lZC1vZmYtYnk6IFJhaHVsIEphaW4gPHJhaHVsLmphaW5Ac2Ft c3VuZy5jb20+DQotLS0NCiBpdy5jIHwgMiArLQ0KIDEgZmlsZSBjaGFuZ2VkLCAxIGluc2VydGlv bigrKSwgMSBkZWxldGlvbigtKQ0KDQpkaWZmIC0tZ2l0IGEvaXcuYyBiL2l3LmMNCmluZGV4IGRj OTk1NjYuLjFlOTEzYjYgMTAwNjQ0DQotLS0gYS9pdy5jDQorKysgYi9pdy5jDQpAQCAtNDc3LDgg KzQ3Nyw4IEBAIHN0YXRpYyBpbnQgX19oYW5kbGVfY21kKHN0cnVjdCBubDgwMjExX3N0YXRlICpz dGF0ZSwgZW51bSBpZF9pbnB1dCBpZGJ5LA0KIAl3aGlsZSAoZXJyID4gMCkNCiAJCW5sX3JlY3Zt c2dzKHN0YXRlLT5ubF9zb2NrLCBjYik7DQogIG91dDoNCi0JbmxfY2JfcHV0KGNiKTsNCiAgb3V0 X2ZyZWVfbXNnOg0KKwlubF9jYl9wdXQoY2IpOw0KIAlubG1zZ19mcmVlKG1zZyk7DQogCXJldHVy biBlcnI7DQogIG5sYV9wdXRfZmFpbHVyZToNCi0tIA0KMS45LjE=

#1 lore raw
Quoted 5 lines · Amit Khatri

Hi Johannes,

Subject: [PATCH 2/4] iw: Avoid possible memory leak for cb. cb got memory from
nl_cb_alloc() but not doing free

Please fix your submission process to not mangle patches. I've applied patch 1 in this series and fixed it up manually, but having the subject again inside the email just makes it harder for me to pick up the patches.

Quoted 11 lines
---
 iw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
iw.c +0 -0
index dc99566..1e913b6 100644

iw.c static int __handle_cmd(struct nl80211_state · line 483

Quoted 8 lines
iw.c +1 -1
@@ -477,8 +477,8 @@ static int __handle_cmd(struct nl80211_state 
 *state, enum id_input idby,
 	while (err > 0)
 		nl_recvmsgs(state->nl_sock, cb);
  out:
-	nl_cb_put(cb);
  out_free_msg:
+	nl_cb_put(cb);
 

Please don't leave two equivalent labels, remove one of them and replace the users.

johannes