mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	wifi: mac80211: fix error path key leak
In the previous key leak fix for the other error
paths, I meant to unify all of them to the same
place, but used the wrong label, which I noticed
when doing the merge into wireless-next. Fix it.
Fixes: d097ae01eb ("wifi: mac80211: fix potential key leak")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
			
			
This commit is contained in:
		
							parent
							
								
									91d20ab9d9
								
							
						
					
					
						commit
						02e0e426a2
					
				
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
					@ -912,7 +912,7 @@ int ieee80211_key_link(struct ieee80211_key *key,
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	if (ieee80211_key_identical(sdata, old_key, key)) {
 | 
						if (ieee80211_key_identical(sdata, old_key, key)) {
 | 
				
			||||||
		ret = -EALREADY;
 | 
							ret = -EALREADY;
 | 
				
			||||||
		goto unlock;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	key->local = sdata->local;
 | 
						key->local = sdata->local;
 | 
				
			||||||
| 
						 | 
					@ -940,7 +940,6 @@ int ieee80211_key_link(struct ieee80211_key *key,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 out:
 | 
					 out:
 | 
				
			||||||
	ieee80211_key_free_unused(key);
 | 
						ieee80211_key_free_unused(key);
 | 
				
			||||||
 unlock:
 | 
					 | 
				
			||||||
	mutex_unlock(&sdata->local->key_mtx);
 | 
						mutex_unlock(&sdata->local->key_mtx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue