From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB469C4708A for ; Thu, 27 May 2021 04:19:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C9B57613CC for ; Thu, 27 May 2021 04:19:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229712AbhE0ETG (ORCPT ); Thu, 27 May 2021 00:19:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:34776 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbhE0ETE (ORCPT ); Thu, 27 May 2021 00:19:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1ED82613CC; Thu, 27 May 2021 04:17:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622089042; bh=YwtOc4Tg+Svlo8Jtch1J7zKrSacNyHqHkXOjHQoQy80=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Qtq06uHradeyvvzD9lycybgu0yS7WerZ66mMtt1xI+f4XmpegVEcv0y5kyuemA/Xi JIaV/T5d3WSF/0drps1HDQnT9EKcoNnwTAhYbqAYY5hf5UaOZc3XBB1qNERiD2NuF1 DwC/N5K76SilGIM9XrRdUngxyDgrblBMiJ4NiyAM= Date: Thu, 27 May 2021 06:17:20 +0200 From: Greg KH To: =?utf-8?B?5oWV5Yas5Lqu?= Cc: rafael@kernel.org, linux-kernel Subject: Re: Suggestion on how to fix "memory leak in snd_ctl_led_register" Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 27, 2021 at 10:49:22AM +0800, 慕冬亮 wrote: > Hi kernel developers, > > The root cause of "memory leak in snd_ctl_led_register" [1] is > unbalanced refcount operations in the device_add function [2]. This > refcount issue causes struct device_private allocated in > device_private_init unable to be deallocated, leading to memory leak. > The details are as follows: Great, can you just send a patch to us to resolve the issue? That's the easiest way to resolve all of this. thanks, greg k-h