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=-5.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 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 8E3F6C47082 for ; Mon, 31 May 2021 10:45:14 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 796C3611CB for ; Mon, 31 May 2021 10:45:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 796C3611CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7D3E7846; Mon, 31 May 2021 12:44:20 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7D3E7846 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1622457910; bh=H2lKsOhkKbQMP1MMXXOhAOoBnemsF+QQm2+NfxhfV0M=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=bQ58TMHXZvygSfp6CptTUMn6hVbbfnrFgszF8dU6GNNSjzDbJSNZS+v8coSxGLOcM RDQd3BOhY3haHI7FlsbZidI/a15LPn258aLBzZCUWJklm0OxuRzASXgXXDcOck2211 byLlwgfpRjr0QIUz8BLAyuF5LXvRwpNd9iDHhwDc= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 0796FF80273; Mon, 31 May 2021 12:44:20 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 836B3F802E2; Mon, 31 May 2021 12:44:18 +0200 (CEST) Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F2240F80161 for ; Mon, 31 May 2021 12:44:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F2240F80161 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="UG44VNpi" Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14VAemX0005914; Mon, 31 May 2021 10:44:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=SVAol3IkzdCV9rAUTFwVdAtE3YampEO4twUVPgNA/0w=; b=UG44VNpiXS9cO57AK+hh6Y9kh1z51yxMC/y4tPff4QNHl44Ip0XS2TvMgw9WIN1igflA +XkZnEjs5D95NjdAsbPeO+gDFJxPlSh42aIc9MZgjc9X7kxqiaQ6ZhWajQ4BRS3jPtXe ZK+uZBkYPIidiJXhNvTFM1kv5YgygtLp1FzYuoLyilLyDr0ZVElvPF0H1tb4+rcbVshv wYo5U0+cy7S7Fm4MFLQEHhjVAOhCzPOE6LQJqKduyb5m/B/qCcTc2bqv97wiuUu7DS8g bYRrbo8wOkIYTY1HjANiVZNbiEBNe/aNquQEt5tYmgMoC4t2ZMsfnQEAL6dWmQLClcgB 7g== Received: from oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 38vng405eb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 May 2021 10:44:10 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 14VAdwXn071944; Mon, 31 May 2021 10:44:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 38ude61en4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 May 2021 10:44:09 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 14VAi9L8096696; Mon, 31 May 2021 10:44:09 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 38ude61em3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 May 2021 10:44:09 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 14VAi3EC025081; Mon, 31 May 2021 10:44:06 GMT Received: from kadam (/41.212.42.34) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 31 May 2021 03:44:02 -0700 Date: Mon, 31 May 2021 13:43:55 +0300 From: Dan Carpenter To: Dongliang Mu Subject: Re: [PATCH] ALSA: control led: fix memory leak in snd_ctl_led_register Message-ID: <20210531104355.GZ24442@kadam> References: <20210531044022.GU24442@kadam> <20210531070337.GV24442@kadam> <20210531084613.GX24442@kadam> <20210531093817.GY24442@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-ORIG-GUID: XCihNY3fDneTXD-F4HpgD00nJDfkn9H2 X-Proofpoint-GUID: XCihNY3fDneTXD-F4HpgD00nJDfkn9H2 Cc: syzbot+08a7d8b51ea048a74ffb@syzkaller.appspotmail.com, linux-kernel , alsa-devel@alsa-project.org, tiwai@suse.com X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Mon, May 31, 2021 at 06:35:33PM +0800, Dongliang Mu wrote: > On Mon, May 31, 2021 at 5:38 PM Dan Carpenter wrote: > > > > On Mon, May 31, 2021 at 05:10:49PM +0800, Dongliang Mu wrote: > > > Hi Dan, > > > > > > I wonder if we shall split the current patch into two patches, one > > > patch for each memory leak. It is better to satisfy the rule - "one > > > patch only fixes one issue". > > > > > > We should absolutely fix all these memory leaks. But one patch for two > > > different bugs with different objects and different paths is not very > > > suitable. > > > > > > > I would just send one patch, because I only see it as one bug. But you > > do what you think is best. > > If you think they are the same bug, that's great. Just send and apply > only one patch as it is. I will not send version v2. Sorry for the miscommunication. That's not what I meant at all. Your patch only introduces one put_device(). We need all five to fix the bug, and we'll have to change the kfree(link_whatever). Use device_unregister() instead put_device(). Include a Reported-by with the correct syzkaller information. > > BTW, could you please show me the syzbot link for the bug you tried to > resolve? If it is not from syzbot dashboard, can you please show the > bug report? What are you talking about? I'm not trying to fix a syzkaller bug. I'm just reviewing your patch. regards, dan carpenter 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=-7.6 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,UNPARSEABLE_RELAY,USER_AGENT_SANE_1 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 4A242C47080 for ; Mon, 31 May 2021 10:44:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 241956135A for ; Mon, 31 May 2021 10:44:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231285AbhEaKqf (ORCPT ); Mon, 31 May 2021 06:46:35 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:59058 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230521AbhEaKqd (ORCPT ); Mon, 31 May 2021 06:46:33 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14VAemX0005914; Mon, 31 May 2021 10:44:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=SVAol3IkzdCV9rAUTFwVdAtE3YampEO4twUVPgNA/0w=; b=UG44VNpiXS9cO57AK+hh6Y9kh1z51yxMC/y4tPff4QNHl44Ip0XS2TvMgw9WIN1igflA +XkZnEjs5D95NjdAsbPeO+gDFJxPlSh42aIc9MZgjc9X7kxqiaQ6ZhWajQ4BRS3jPtXe ZK+uZBkYPIidiJXhNvTFM1kv5YgygtLp1FzYuoLyilLyDr0ZVElvPF0H1tb4+rcbVshv wYo5U0+cy7S7Fm4MFLQEHhjVAOhCzPOE6LQJqKduyb5m/B/qCcTc2bqv97wiuUu7DS8g bYRrbo8wOkIYTY1HjANiVZNbiEBNe/aNquQEt5tYmgMoC4t2ZMsfnQEAL6dWmQLClcgB 7g== Received: from oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 38vng405eb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 May 2021 10:44:10 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.podrdrct (8.16.0.36/8.16.0.36) with SMTP id 14VAdwXn071944; Mon, 31 May 2021 10:44:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by aserp3020.oracle.com with ESMTP id 38ude61en4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 May 2021 10:44:09 +0000 Received: from aserp3020.oracle.com (aserp3020.oracle.com [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 14VAi9L8096696; Mon, 31 May 2021 10:44:09 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 38ude61em3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 May 2021 10:44:09 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 14VAi3EC025081; Mon, 31 May 2021 10:44:06 GMT Received: from kadam (/41.212.42.34) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 31 May 2021 03:44:02 -0700 Date: Mon, 31 May 2021 13:43:55 +0300 From: Dan Carpenter To: Dongliang Mu Cc: perex@perex.cz, tiwai@suse.com, alsa-devel@alsa-project.org, linux-kernel , syzbot+08a7d8b51ea048a74ffb@syzkaller.appspotmail.com Subject: Re: [PATCH] ALSA: control led: fix memory leak in snd_ctl_led_register Message-ID: <20210531104355.GZ24442@kadam> References: <20210531044022.GU24442@kadam> <20210531070337.GV24442@kadam> <20210531084613.GX24442@kadam> <20210531093817.GY24442@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-Proofpoint-ORIG-GUID: XCihNY3fDneTXD-F4HpgD00nJDfkn9H2 X-Proofpoint-GUID: XCihNY3fDneTXD-F4HpgD00nJDfkn9H2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 31, 2021 at 06:35:33PM +0800, Dongliang Mu wrote: > On Mon, May 31, 2021 at 5:38 PM Dan Carpenter wrote: > > > > On Mon, May 31, 2021 at 05:10:49PM +0800, Dongliang Mu wrote: > > > Hi Dan, > > > > > > I wonder if we shall split the current patch into two patches, one > > > patch for each memory leak. It is better to satisfy the rule - "one > > > patch only fixes one issue". > > > > > > We should absolutely fix all these memory leaks. But one patch for two > > > different bugs with different objects and different paths is not very > > > suitable. > > > > > > > I would just send one patch, because I only see it as one bug. But you > > do what you think is best. > > If you think they are the same bug, that's great. Just send and apply > only one patch as it is. I will not send version v2. Sorry for the miscommunication. That's not what I meant at all. Your patch only introduces one put_device(). We need all five to fix the bug, and we'll have to change the kfree(link_whatever). Use device_unregister() instead put_device(). Include a Reported-by with the correct syzkaller information. > > BTW, could you please show me the syzbot link for the bug you tried to > resolve? If it is not from syzbot dashboard, can you please show the > bug report? What are you talking about? I'm not trying to fix a syzkaller bug. I'm just reviewing your patch. regards, dan carpenter