Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp221997pxx; Wed, 28 Oct 2020 03:15:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy5HDyB3ycbpVZLb/ji2hmd6pPDygwpf+eZQmCdEHXsxZv1HCG4tcpPpwZDXLpuEGv9ss94 X-Received: by 2002:a05:6402:1c04:: with SMTP id ck4mr7049220edb.274.1603880152832; Wed, 28 Oct 2020 03:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603880152; cv=none; d=google.com; s=arc-20160816; b=cb3802K5GjtiUmAM1o6CkVne8nmeDOofAub4CU1lPqxDjR3wDcPhIp8DHuAIf4YAON RVCfdRzG5w90jog1hK5JsqbpsAGMpU+LR08YpjMXLdSK6zd6d3vVt37fcOuKECed/joa t55LS/Q5H+6RH73uQGuRAtXq/J8HZfHDBQrInxWF72E2Rec89KtQ+8jO49ubw44KLNac 8fF2W6QfW09xWRgvHmbUXs5A3TVG8zFOEeL9CEcZa2wBgR8JK2cNTW6EbiecjfkyqG/U ikevi+l+kjHeyYUvrFaNo9dnRk4PDGzp7H7yT9V0J+BV+Aj1RXskj4VXUumxhgv2zA0F wOaQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=GqQfqgmvLqHTcMOqCJhmcFRwYZYHGZbGSkaX6Cy6t8I=; b=apeYRiYIn8163q+/w+0NSH+pksfrK8LJPO+nAOBdDmPsk140J/mqtmxt9FP593JUss rbW0ARnfDbZghh30WtY/KFfdjYh4v2P2ahaZ3XhfC6Dt7sRY1t9XkG5PGadA4qwyO/hB gMsdcrkMp76DogLeSOfDe5SyG/ebiKP3bWhlmBGZRAZCYNJKFmVcaQrAus+C9dy9Bp8/ Zu2dEmcHt6qCaaP/QN9qKlwsfgUS7mBbCTbs3D+urszMIJPjrK/CGxaJIOFiDxV+h2og hHyaAjDvq0/4Lc/s5d+vsrgbpEU/32RYoTJwulvllPmzhxszEB3SOPcGnqxYthxd1wa7 4bQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=JJ5FtbSa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b29si2827715edn.354.2020.10.28.03.15.30; Wed, 28 Oct 2020 03:15:52 -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=@kernel.org header.s=default header.b=JJ5FtbSa; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760825AbgJ0Ogh (ORCPT + 99 others); Tue, 27 Oct 2020 10:36:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:35044 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760741AbgJ0OgN (ORCPT ); Tue, 27 Oct 2020 10:36:13 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 109AB207BB; Tue, 27 Oct 2020 14:36:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809372; bh=kDkWw07+ycoeL9g5Rbqp86xLJvlkFUxmFz1Zdoqi1e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JJ5FtbSalGATYM6Kb3GkaY9ffVxGMh+ILvdZ69ULBC8I1+l7lhlLFrmaHhuUmWHFS uD4G39m2pq6CU7fdD2rS7sDNAXk/HCd2pAISd7z/jqGcmnA5jc0oEgizicDMvwUzZY fD3bvrdzHVeV+pHNz6OZqUUy8Lf/mjQz/EZnQYMY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Leach , Suzuki K Poulose , Tingwei Zhang , Mathieu Poirier , Sasha Levin Subject: [PATCH 5.4 172/408] coresight: etm: perf: Fix warning caused by etm_setup_aux failure Date: Tue, 27 Oct 2020 14:51:50 +0100 Message-Id: <20201027135503.074846948@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tingwei Zhang [ Upstream commit 716f5652a13122364a65e694386b9b26f5e98c51 ] 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()") Reviewed-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Tingwei Zhang Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200928163513.70169-9-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 c4b9898e28418..9b0c5d719232f 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