From patchwork Mon Jan 11 03:37:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 7998941 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 74BFC9F1CC for ; Mon, 11 Jan 2016 03:38:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B20702024C for ; Mon, 11 Jan 2016 03:38:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AD4DA20220 for ; Mon, 11 Jan 2016 03:38:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758054AbcAKDiM (ORCPT ); Sun, 10 Jan 2016 22:38:12 -0500 Received: from m12-12.163.com ([220.181.12.12]:54543 "EHLO m12-12.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758005AbcAKDiK (ORCPT ); Sun, 10 Jan 2016 22:38:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=8GA+z2TZk6IfcFQcgZ lqSb1DQyY29tPEUUe0ZGfceJM=; b=ABHJq6T/hi0ZbnzlFkCn0om/nBOHFkFRaI Mg+EBbQu1bYGr/WaueaVyVM987xBvvtrn88L+bl8jUJ/qJlySrnmptdp6twtjLsR 5vsodFDxpz8v19P8WnJSsG+ywmfHoqEqlplzNOlTJ7hU86Z0t+dpnYd3GhOYIkse C/Q1IBbzw= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.58]) by smtp8 (Coremail) with SMTP id DMCowECpzG9qI5NWtG+dAA--.107S2; Mon, 11 Jan 2016 11:37:18 +0800 (CST) From: Jia-Ju Bai To: kvalo@codeaurora.org, zajec5@gmail.com, joe@perches.com, davem@davemloft.net, m@bues.ch, johannes.berg@intel.com Cc: linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] b43: Fix a memory leak in b43_bus_dev_ssb_init Date: Mon, 11 Jan 2016 11:37:36 +0800 Message-Id: <1452483457-568-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: DMCowECpzG9qI5NWtG+dAA--.107S2 X-Coremail-Antispam: 1Uf129KBjvdXoWrtw4UCF4DGw47Ary8XF1DJrb_yoWxZFX_Cr 18CF1fJryrJw1jkr48CFsrZrWjvF1DXFn3G3ZIqayrKay7JrZ3JryFvFy3Jr9rur4IkFy7 Crnrt3W8A340vjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUjWEE5UUUUU== X-Originating-IP: [166.111.70.58] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbiTg-selUCqW0oqAAAsE Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,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 The memory allocated by kzalloc in b43_bus_dev_ssb_init is not freed. This patch fixes the bug by adding kfree in b43_ssb_remove. Signed-off-by: Jia-Ju Bai --- drivers/net/wireless/b43/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index ec013fb..6d251a0 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c @@ -5798,6 +5798,7 @@ static void b43_ssb_remove(struct ssb_device *sdev) b43_leds_unregister(wl); b43_wireless_exit(dev, wl); + kfree(dev); } static struct ssb_driver b43_ssb_driver = {