Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5937074rwd; Mon, 5 Jun 2023 10:28:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6AMVqLhvdg8O7whiDXbyReP0/isEDQSkamhiurhauHFoHdoEeO9c4tZQsxf2jvvpPn8bCd X-Received: by 2002:a17:90a:4589:b0:258:de25:5e2f with SMTP id v9-20020a17090a458900b00258de255e2fmr3457944pjg.38.1685986118282; Mon, 05 Jun 2023 10:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685986118; cv=none; d=google.com; s=arc-20160816; b=Sg4COOgrCmdIbNTB/VgkY29jruQDZhycg2s0YWXtS+bQ/dNMx6iAUCQ36QHOpJQ99T Z3oj5RHPqazTMgWO+WqOS8Fy6oGX3f5rqJH7uqB1VAcJwZMserSfigKm9fxYrdFPNb9M ErHgE1ammQ7lBJDbaHJ63qXIGdP1jWsE7d9RqOWdcck9Ya/Og6DHAom0v63b615O1Jb7 VTdIeonr2+jcIT75BjIevidldZjx7hXa4dB/aYesY3acXA2Qo52rXN7sJoIqdAAj5Xny AVqueu5jj/FzmYue1b/mbDtYaVIq4vDc1XgBQk3fpGGUQ+xqdxKbtyY5W+WTnANyc7nt Qhkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=z6auQlvkq1uhQoIFWtxgtCpiXOy2zqy+h8MbsWDLg1s=; b=if9HLWltZJFVY4RYa3oeyQVntOk5gJbL2wzjJEgHXN3uyfmdqcpNFovBMkchKa2eFt 5pueZrTahpkSMUhta1LKe6tOvDeRD50Gn0fw9FFwBnt9xpgA7G+dyXm0Y6NQAT/36Z9z wI2idL4/LR8abijp9L2NYVdanrXuyOLBIflrDT3IjDgoR22Nc0OW7/xQoCTumtwGZS+W CsTCV/xXMclZlfYXSp9GNScuufXUdKDGW78rJuZjMPnHxBmOOJj5+oo6RhXVun/1iJAi CWoIzS8GlZkdpYQLTb6dTjtfci4l8Wi+Qk4BI2lAKHDqZ6MsYARg80JIjCjYF2cYkto8 4xkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFfMJmoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d16-20020a17090abf9000b0024e29660f61si7574199pjs.90.2023.06.05.10.28.26; Mon, 05 Jun 2023 10:28:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aFfMJmoq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233988AbjFEQf1 (ORCPT + 99 others); Mon, 5 Jun 2023 12:35:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232040AbjFEQfW (ORCPT ); Mon, 5 Jun 2023 12:35:22 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5012594; Mon, 5 Jun 2023 09:35:21 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E0DFF62395; Mon, 5 Jun 2023 16:35:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F31B9C4339C; Mon, 5 Jun 2023 16:35:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685982920; bh=PGCW96JiQOoQ+srOEeKWAWw1o+ime25VSyyUsDf6T7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aFfMJmoqJHMfuhevocY5Ej1nQyRqHICePni5FK6+IHXSNHZ9fs9HA1c41WKGYQCHL yfvMilAtCuW+uAqHrwbXR/5dyPcde50kNAodtMGSiaBMKfIyv4Ic0nG8PY0zTejLVt OWCUiDE3oae0r6848b4NhceZ52JL1uGUju1fIduWXGbh/HDvqVs2RxxsngGKL0WRDk 8qw+Kox7t++ToevORZBue5QAjBpxzzFjG7ajCKDl3OSG1mc5rMvAkw3Czy6uftDWKF mD5+0MJ0NBQuGG+zril0338ZUhxdA/gBGs10CFHGhZb/2MgOJFtg6plauFcfCROGew rFM7ltNJr+cDA== From: Will Deacon To: Bjorn Andersson , Mark Rutland , Neil Leeder , Andy Gross , Konrad Dybcio , Christophe JAILLET Cc: catalin.marinas@arm.com, kernel-team@android.com, Will Deacon , linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust Date: Mon, 5 Jun 2023 17:35:03 +0100 Message-Id: <168597368753.3035523.1877159803159338194.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <6a0f5bdb6b7b2ed4ef194fc49693e902ad5b95ea.1684397879.git.christophe.jaillet@wanadoo.fr> References: <6a0f5bdb6b7b2ed4ef194fc49693e902ad5b95ea.1684397879.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 18 May 2023 10:18:08 +0200, Christophe JAILLET wrote: > If an error occurs after calling list_add(), the &l2cache_pmu->clusters > list will reference some memory that will be freed when the managed > resources will be released. > > Move the list_add() at the end of the function when everything is in fine. > > This is harmless because if l2_cache_pmu_probe_cluster() fails, then > l2_cache_pmu_probe() will fail as well and 'l2cache_pmu' will be released > as well. > But it looks cleaner and could silence static checker warning. > > [...] Applied to will (for-next/perf), thanks! [1/1] perf: qcom_l2_pmu: Make l2_cache_pmu_probe_cluster() more robust https://git.kernel.org/will/c/7bd42f122c7c Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev