Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3154781pxk; Mon, 28 Sep 2020 09:37:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwO9VkqvFry7eLa/+HuihATej+AfMvZebu1rC4n546jx7oOVaDFbhmqybT7/XzKruwtDs+l X-Received: by 2002:a17:906:1485:: with SMTP id x5mr2540929ejc.163.1601311057256; Mon, 28 Sep 2020 09:37:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601311057; cv=none; d=google.com; s=arc-20160816; b=CoFevrmj0MSWLP9j65DvJoexmnzMqVPtsDHXEUC4QdymC6HZe5iAY+0D6jQRUfr8hL tfF8mZ8hfmDDaRy3jYFx2wP7GvC0n0c0x2npeTi+nKtKBVfDQCfWAJaNpzVLBmS8+/cD qhuPt2sjfNmfL7GHAXPIQiExJ4VlyyMgY/msdcyBf83HX/epw4vuq7ypiWjKP3/U4+Rf P5EFYQOznKSokiuBjSrwcrH6EA0pj415d8a7/+WCXdGEpQX+rO+llH3YHQKP1IL7CKva RYDI7CRQKUu6G/02VCmkhan2nXlhNn2kaiMHWPjlVAwIkP9swlqVmQ73Mmjm1YVS5Swj 64Dg== 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=XKxXl3MciKAKZSXIF+TmSJQtPsXbnsXWSEMuZ9mJPpY=; b=M+El7nrlsL0Zjf4wj1fLxA8dkgSJgIeQQKZt/v3Eaxfkyfu2rrJck94/a9IvuAvkpH GmAKxRqdGzC6G9j1tGpqiUdtY51YuHt98E5dHdMylALUyF+x0XCSbKARxCfSYoOs/Uwi RBjkV+b+5UfZagsPIWTXdjXJAPI1wzAv/cs3JR+ABI+VYcGubQ8IL07MMuYgoPrLP4+z wf35Jw3KzqW/qn/iuhomrvwWfgg1xlI9AgzE58M+oIYHkJN38AMin3/CXt2yroQG4CKL vgu8o4I/646JGUeDd0VCxBTqGWXWVKjv6EiGF9b3UId+9fHnV7xcQkBIBN4C6ooPTT6D yvvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wX2X5i59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v23si875774ejf.312.2020.09.28.09.37.14; Mon, 28 Sep 2020 09:37:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wX2X5i59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgI1Qfm (ORCPT + 99 others); Mon, 28 Sep 2020 12:35:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726735AbgI1QfY (ORCPT ); Mon, 28 Sep 2020 12:35:24 -0400 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3214C0613CE for ; Mon, 28 Sep 2020 09:35:23 -0700 (PDT) Received: by mail-pj1-x1042.google.com with SMTP id t7so973639pjd.3 for ; Mon, 28 Sep 2020 09:35:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XKxXl3MciKAKZSXIF+TmSJQtPsXbnsXWSEMuZ9mJPpY=; b=wX2X5i59Q63zjV8FYOMQuBp2F1hmgrLrZqqrLaKd4BDNrFbhimrmks4UAk17E/DdEs 0b3VI/DqBsXAS9EKSrgz4xpOwh/vYMpG5MQnmTbfelr5mKyG6t/Pj+QJTxGGC3oyAd7d Fa9fVMlDS3nHJ0ZuHq1Xm+0QP3tTrmrdvlsM2epdkuUd5WlhVCHLzWQ7EoTMxlX7JZFq 8ExavDjFgiiwaQ5L6cXoQYvbqkl/IFVHVoD6aGO0HSyFqo++UiNjX7og4SNffWb6oZ4z vEPhZJ98iwTd5zQHZlCNvraJkehqL6SMQqG75AOw+eeEjW3mSA6ZS/E4ERKLWBsnoe0w OcVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XKxXl3MciKAKZSXIF+TmSJQtPsXbnsXWSEMuZ9mJPpY=; b=RfIphKXPcDjlM9nAD3VahKFphT2YzFTDi+HgjHj+F13MDFqfGUfIcWTJ6oJjUvQvK1 FNzn3CkbcNhkClDTsfScOo6dy/32bIaSQtDVLXjCLuDvOvA+thHQVcdQMz4YgqaBqZll rXXQaAl2vQxbCpV7ddewJt5C2Nghmb1bpeYUsyfFGGXwsYVI9meoxhSrPw/bwdy0vJbv vfvmeM/P+voYc+8l39/MLJnybY/csIdZVWOYPuewk+SV85mxHqWGnchVeX5/SuwnlF3D 4kE7TlC1R/rzp5LaT+BxVR+ySD/upViPX2qGjXy8v7z7BNScw+zO4iuYqPoGu6UHb9vB 0a+w== X-Gm-Message-State: AOAM531Sf5PnWm6ZFE+WDgEa7OGiwKdkVOwmlPc3RBuYEXyGnKC58uIe Nq7hrr6QX5wkLlB6Ydlbz6syvw== X-Received: by 2002:a17:90b:1988:: with SMTP id mv8mr133408pjb.23.1601310923548; Mon, 28 Sep 2020 09:35:23 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id f19sm2345640pfd.45.2020.09.28.09.35.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 09:35:22 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 08/25] coresight: etm: perf: Fix warning caused by etm_setup_aux failure Date: Mon, 28 Sep 2020 10:34:56 -0600 Message-Id: <20200928163513.70169-9-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200928163513.70169-1-mathieu.poirier@linaro.org> References: <20200928163513.70169-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tingwei Zhang When coresight_build_path() fails on all the cpus, etm_setup_aux calls etm_free_aux() to free allocated event_data. WARN_ON(cpumask_empty(mask) will be triggered since cpu mask is empty. Check event_data->snk_config is not NULL first to avoid this warning. Fixes: f5200aa9831f38 ("coresight: perf: Refactor function free_event_data()") Signed-off-by: Tingwei Zhang Reviewed-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm-perf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index 644805e0a9ec..47894a0dcf5e 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -126,10 +126,10 @@ static void free_sink_buffer(struct etm_event_data *event_data) cpumask_t *mask = &event_data->mask; struct coresight_device *sink; - if (WARN_ON(cpumask_empty(mask))) + if (!event_data->snk_config) return; - if (!event_data->snk_config) + if (WARN_ON(cpumask_empty(mask))) return; cpu = cpumask_first(mask); -- 2.25.1