Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2101026rdb; Sun, 11 Feb 2024 11:16:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IEj1evj+sRlxe5qKi08ahuAgBwPDzC+62kxmijKLHp1et4xtjjav0Ofz1VhqflD+/gX8Sve X-Received: by 2002:a05:6808:1a23:b0:3c0:31d9:3ccb with SMTP id bk35-20020a0568081a2300b003c031d93ccbmr3771848oib.43.1707679010207; Sun, 11 Feb 2024 11:16:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707679010; cv=pass; d=google.com; s=arc-20160816; b=QrTbpy84ObwqQEP++eL70GAaQIiOwqEuwCvB4+UIuZt0xvTnKWmXAWkaLZZqXxzNZe S09ITREA/h1SItB5nki/IxFvCJSFWP+kZtMK8TKh7i7yy+Fao5lNQA/9Q355rPt/i3nI F/a8ky4Fqhy1jeq69rhs/1S4PbHfARnoeA3wx7WfU5CCWRB+W0nrYC3svIo3bLsJR0rE SQNJiXhhSF/ul0LahMQ8ip4wMIo67bbuZtQ443e8vz3vJylrHsqizi9F1UwjPoQK5Cse LxhnQLdIsOz+EbQ0hMXXWrqfUUse2WIaYfKP9fmHJo6KTUofSzyg7MsDuo2A1Qv4ZLEI aHug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:date:from; bh=GGNNgc0F0aH1GVYdHVVOet6w1iiVfAY087vQ/5KSDnE=; fh=MhPtBlrh44IpegwQkNGYBzcmpy1gdWjNg73w8RPcnQ4=; b=U/ftIDxT+vJuSu8/YcOm9ZWbO+w99iCQ8L0+KsLAgeT1Jeku3gBcsmTjlAqjWiRyfY McZEhRK2HV+gU6bBV2qzWzgmRS2s5gdk7qLMNpFcuevyoo7Oj4rDgvAeIK7hIzAtGCLV WGB38eLIzDRZiVsBsNwb0ex4I+u79yO1UIvD5BHUdf3sOdwznWQq80xpVH1TpJu5xZtU sDNTNEtR22QwGtpSBpj8wzSkY++yD8OxyQ7UXW8KwXU+Jio1RtzW6s6t0OonqgnZxMlG y9mmtktklNNpZr+5PC6yuCdAzazruOih3aS0oV08VhIPXUIAUV3fWq8UlzmE6z3Fdrk0 k0rw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-60924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com X-Forwarded-Encrypted: i=2; AJvYcCU6/N0IKRWOWsjcfXKmJoq05fNLWq6hj/Cnw4gIHugMHObLdNYkahDlq9KOBgGti3U0L8s06d/juV9z1UD1nC0BoliWxcMMSieH8Ia2CQ== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id vz4-20020a05620a494400b0078577bdef18si4324864qkn.619.2024.02.11.11.16.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Feb 2024 11:16:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-60924-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id ED6361C22022 for ; Sun, 11 Feb 2024 19:16:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9BD7A5D743; Sun, 11 Feb 2024 19:16:43 +0000 (UTC) Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 837095D72A for ; Sun, 11 Feb 2024 19:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707679003; cv=none; b=d2fg4f7nHE/CV1G8AU6DajXYGOcfjxYA5n6PA9Xjsyrmz2VdEzzSM1iCFW/v1AvQZBjFMdUwJvr9fRZ28zd8RuhpuKHAu/UvDI0YCuG4pJCs9MPWKeaE82Lk1YPKlmBQJqCP4f1oYKuGYmFel6k5Nkr0n6QD6rzpuNEY1Cucc3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707679003; c=relaxed/simple; bh=B8UFaFN2PijZW2D2EgFj8CBpfvYCa/Z8YGiQieVd8JY=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gZJRtGywFI7WbLhE7nQnx+T+5MRH76dIPBil0M2027Q4Fy+NecHsN6l4PoA0v8RV5tvkfxeTDIys1L++PfQqkXjwas57Vj+gJ/RzmdkCx3gjSaxVXEmpIhakK86ph5I2keopYjk0F1gw1AKp3brdFJIupe4M3W+vs8UDfDZJYwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 10e5dd00-c912-11ee-b972-005056bdfda7; Sun, 11 Feb 2024 21:16:33 +0200 (EET) From: andy.shevchenko@gmail.com Date: Sun, 11 Feb 2024 21:16:32 +0200 To: Jonathan Cameron Cc: Dinghao Liu , Lars-Peter Clausen , Alexandru Ardelean , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: core: fix memleak in iio_device_register_sysfs Message-ID: References: <20231208073119.29283-1-dinghao.liu@zju.edu.cn> <20231210133228.5fd425ea@jic23-huawei> <20231217132800.27e83a01@jic23-huawei> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231217132800.27e83a01@jic23-huawei> Sun, Dec 17, 2023 at 01:28:00PM +0000, Jonathan Cameron kirjoitti: > On Sun, 10 Dec 2023 13:32:28 +0000 > Jonathan Cameron wrote: > > > On Fri, 8 Dec 2023 15:31:19 +0800 > > Dinghao Liu wrote: > > > > > When iio_device_register_sysfs_group() fails, we should > > > free iio_dev_opaque->chan_attr_group.attrs to prevent > > > potential memleak. > > > > > > Fixes: 32f171724e5c ("iio: core: rework iio device group creation") > > > Signed-off-by: Dinghao Liu > > Hi. > > > > Looks good to me, but I'd like to leave this one on the list a little > > longer to see if anyone else has comments. > > > Guess no comments! This patch does not fix anything. Yet, it might be considered as one that increases robustness, but with this applied the goto https://elixir.bootlin.com/linux/v6.8-rc3/source/drivers/iio/industrialio-core.c#L2007 can be amended, right? -- With Best Regards, Andy Shevchenko