Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754612AbcDZX5H (ORCPT ); Tue, 26 Apr 2016 19:57:07 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:40407 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754119AbcDZXOK (ORCPT ); Tue, 26 Apr 2016 19:14:10 -0400 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Sudip Mukherjee" , "Johannes Berg" , "Julian Calaby" Date: Wed, 27 Apr 2016 01:02:21 +0200 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 041/217] mac80211: fix memory leak In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8426:ae4:c500:9cba:69ae:962d:6167 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 904 Lines: 30 3.16.35-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Sudip Mukherjee commit ea32f065bd3e3e09f0bcb3042f1664caf6b3e233 upstream. On error we jumped to the error label and returned the error code but we missed releasing sinfo. Fixes: 5fe74014172d ("mac80211: avoid excessive stack usage in sta_info") Reviewed-by: Julian Calaby Signed-off-by: Sudip Mukherjee Signed-off-by: Johannes Berg Signed-off-by: Ben Hutchings --- net/mac80211/sta_info.c | 1 + 1 file changed, 1 insertion(+) --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -551,6 +551,7 @@ static int sta_info_insert_finish(struct __cleanup_single_sta(sta); out_err: mutex_unlock(&local->sta_mtx); + kfree(sinfo); rcu_read_lock(); return err; }