From patchwork Tue Feb 2 07:51:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 8187391 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0BC57BEEE5 for ; Tue, 2 Feb 2016 07:51:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 40DED20268 for ; Tue, 2 Feb 2016 07:51:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6593B20266 for ; Tue, 2 Feb 2016 07:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753139AbcBBHvY (ORCPT ); Tue, 2 Feb 2016 02:51:24 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33085 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752694AbcBBHvX (ORCPT ); Tue, 2 Feb 2016 02:51:23 -0500 Received: by mail-pf0-f175.google.com with SMTP id w123so6103769pfb.0; Mon, 01 Feb 2016 23:51:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=JtkS6adHUtl7wpnRDU5rJyPxO0T73IDKBxjeSd9aY10=; b=O8uPdT2LQJ1SoitwKSHnETdUjChUM8wZet3s9W6LBH4Wv8t6uYy0AYNU95vDrarR3p 4OjjuhrGmCL61U8HbzD+tWA8rJNHkO4ycOzA+BVGEKo9sBrdDfnVzMuq05aBhTfPQp7j gl+Q77L61UP68kAN7El75yaXnFjLTPBjLncwYMxitU0u4bND23vCPmHPgWwyAkhsK4ar 0ruN50quKLn8WrsdwlU95R+IvyA1OGUx8NEUu4DmwDiWszFPgNZ0/AWPnPhNbHCWAIzZ XbagiVPtMUGeFfDGvQqNw1XyJmxuwMuY7ho9RLi8/Hcc3ZRhZ3yIug17TVDJDeul6TU2 uo0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JtkS6adHUtl7wpnRDU5rJyPxO0T73IDKBxjeSd9aY10=; b=fyuIsOwQGvyrcx+P7IvAjwSCtdqmSXH8m336JnpMS/N53HcoeTfbWMst1mYc21SjG5 bc49Z3gCwp+7bp0BXwLt7gtIZ5oe7l7QpUdyEfIBq4NergcAJ0TspKJZnK2eF/MYNLMs WXlmpO9B5DOG6Bu4LYn07l3wlnW4vug+MAOfViZKzu9H//0TmZBq0EFH1FzhshgkRRQV N+U8wd/eNJDGr8UsedO1tPytZXaEpd66DadpsFbxUPWDtWxTZsd2nh0TDP8lHfummzi9 3niQ5ZmzjN1MGs+R3QOavzlcLVs6XFk3AysJySK6iwNVd6T0YhyczhOEVGd0jAy8iz9u nHRA== X-Gm-Message-State: AG10YOSCoYwRhY5fd641jDcchOg0ip7v2pDvqvNKlJGdmhuNlh683ptsMu2sOlJGIxMQ6A== X-Received: by 10.98.79.28 with SMTP id d28mr28347319pfb.77.1454399482509; Mon, 01 Feb 2016 23:51:22 -0800 (PST) Received: from sudip-pc.vectortproxy.org ([183.82.228.136]) by smtp.gmail.com with ESMTPSA id 1sm353480pfm.10.2016.02.01.23.51.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 23:51:22 -0800 (PST) From: Sudip Mukherjee To: Johannes Berg , "David S. Miller" Cc: linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, Julian Calaby , Kalle Valo Subject: [PATCH v2] mac80211: fix memory leak Date: Tue, 2 Feb 2016 13:21:14 +0530 Message-Id: <1454399474-11350-1-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sudip Mukherjee 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 --- v2: added Fixes tag, Reviewed-by and From:. net/mac80211/sta_info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c index 6c198e6..36e75c4 100644 --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c @@ -561,6 +561,7 @@ static int sta_info_insert_finish(struct sta_info *sta) __acquires(RCU) __cleanup_single_sta(sta); out_err: mutex_unlock(&local->sta_mtx); + kfree(sinfo); rcu_read_lock(); return err; }