Received: by 10.192.165.148 with SMTP id m20csp3451174imm; Mon, 23 Apr 2018 06:51:54 -0700 (PDT) X-Google-Smtp-Source: AIpwx48kWeLoIwYLNjHuQEetEcT3wItvdjtq3AwC1s7hZfz9J6LcxlJi18riOOPPblI/5iW2kviY X-Received: by 10.99.188.9 with SMTP id q9mr16958891pge.381.1524491514109; Mon, 23 Apr 2018 06:51:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524491514; cv=none; d=google.com; s=arc-20160816; b=E04w0fmnc5DGNo7h/BXFu9bmFEBVIa4B8+MQZe8dlhJt6jAUpwgtB1uV1TntaFcPkT cQo57xEDpXugb9ZwguPmLSX3JL+/KqRU4FCaGr9dNdAJ/Jvgd7ZmMxbNVxdBcwAueqf5 2ZLR6Hnd/iLh/qUG+1lYFonbS8SLDUqfgO4lkJdxH+ISfNUQELrhf11DPvjctrNMvEe1 a4edKn617c41u+XxRtv2Tn8yvwP2ZqihZBN97tKk/n1I+M4ApXKjqtsSqjDAVH6VWVF7 WIFm6UMnGp3ylKp/DSzGMho9XFAVryjhGfRkPrZmmkZFkXWY+DSllwYJQFjFE89VtRMK hHVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=/GNeNQQlmSsLHwe7WvHCt/XpL7Xs1+rsIPfUcpO6RzQ=; b=f/Gm2IaysOdtElMiTH9RNOelvRD2jYEXAExRO3zUEQCyDqHJtTr65r5pHHz3OcWZpd vixHoT2nyzqGD3ha+PuYNF8upbOm4YNynsznicF/Vo6aGp/JlfbAtplXOTH37/tgj0+3 Luq3MAS33oJj2XdIMVxUPiFHb6ZIDO1aKQjcMczP29dI+PNjWsozqGpcUtq4ttTyONXM ZVQhRHlvnTaecG8XBzokY9nX5ddoI4IvPUQxoCuWF7d+t+CnVHbha0/krzENsGcSst72 9W9KXBZE8CllNkWq/U7Mxyjpq/uZxEFUtooXL+w5VM3ucsMqWhDKzfJUkhgyaISvCpwQ tNMg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k190si4883519pgc.141.2018.04.23.06.51.39; Mon, 23 Apr 2018 06:51:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755335AbeDWNub (ORCPT + 99 others); Mon, 23 Apr 2018 09:50:31 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41112 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755185AbeDWNua (ORCPT ); Mon, 23 Apr 2018 09:50:30 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A05A5C13; Mon, 23 Apr 2018 13:50:29 +0000 (UTC) Date: Mon, 23 Apr 2018 15:50:24 +0200 From: Greg Kroah-Hartman To: Kirill Marinushkin Cc: Andy Shevchenko , Eric Anholt , Stefan Wahren , Florian Fainelli , Ray Jui , Scott Branden , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] staging: bcm2835-audio: Disconnect and free vchi_instance on module_exit() Message-ID: <20180423135024.GA2337@kroah.com> References: <20180417050028.19372-1-k.marinushkin@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180417050028.19372-1-k.marinushkin@gmail.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 17, 2018 at 07:00:28AM +0200, Kirill Marinushkin wrote: > In the current implementation, vchi_instance is inited during the first > call of bcm2835_audio_open_connection(), and is never freed. It causes a > memory leak when the module `snd_bcm2835` is removed. > > Here is how this commit fixes it: > > * the VCHI context (including vchi_instance) is created once in the > platform's devres > * the VCHI context is allocated and connected once during module_init() > * all created bcm2835_chips have a pointer to this VCHI context > * bcm2835_audio_open_connection() can access the VCHI context through the > associated bcm2835_chip > * the VCHI context is disconnected and freed once during module_exit() > > After this commit is applied, I don't see other issues with the module's > init/exit, so I also remove the associated TODO task. > > Steps to reproduce the memory leak before this commit: Patch dropped due to kbuild complaints. Please fix up and resend. thanks, greg k-h