Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp274967pxx; Wed, 28 Oct 2020 04:45:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8LxBYF3BA3aNBNCxxvUbM32QRQ9hoUJoX84TPwe1NFTOr+CtPNXNa1HwgxNRq3dqlanPQ X-Received: by 2002:a17:906:714b:: with SMTP id z11mr7012631ejj.139.1603885530561; Wed, 28 Oct 2020 04:45:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603885530; cv=none; d=google.com; s=arc-20160816; b=m5T63sYD0lkl8HjwmnH35NXMWt1A58QX0U5Tgrkfdl+EOWueY1DYIo55MIW1Wo5IaK fVAmORq8G02bQ8KVlgKlqHii5houW5i/iXL7ZyNgyvKRJ8xSBK4iB545yB7NDWmMuMXx kxrJc7kno6QInOPRYQ9kw97gaL7BJTiuWMF7wpEb9d0Z9VhTZ17GSI/4o1POcKVeUIwW Emjsy5rvzx3S03UYoTVlMmyVX3iZnm64zCvqNRB/6v5SLfSEAxUUF9K6WU+RS/FnFxrz o9SijtVDqWMD7IWXkx9q3fzIoguxWxfT6NQC/35yyDps5+W8/CtVlCh4UYrs6pjuztkf FD9w== 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=C9B+QMPUUrk0A7b/9lm3wLs4QP0LQd+w7gYcTfnpMmPXTupkE1bNLX5X1WD3EcIEP9 7V9r3+WBqEMvAoX5bF8URTtlhaFUIqpx2kiGIG9x/vENQgzaOS5ASVbclnQzIn4UqON7 mlwKQVQtet0tXbEutl/BCC7iXeaaCoJdrz7DhGohNt7AtV0XC3pGFfThEtfSpyzdzl2d 18niE8nTA2GUqbTBaXWiwAMSV+CUjDJErV5SlqAoteyocdXSExpriMh32K2uETwCZu/u 239TTm0i8fpjUX+j04S0jBDWVb47mKnmU6eXLcUyah8E8cGhsO3/KOCqp1YAH//5anic Nszg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hf4KMFy6; 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 dk22si2709939edb.258.2020.10.28.04.45.07; Wed, 28 Oct 2020 04:45:30 -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=Hf4KMFy6; 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 S1794390AbgJ0PLf (ORCPT + 99 others); Tue, 27 Oct 2020 11:11:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:35896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1789327AbgJ0PBz (ORCPT ); Tue, 27 Oct 2020 11:01:55 -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 C670022264; Tue, 27 Oct 2020 15:01:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810914; bh=kDkWw07+ycoeL9g5Rbqp86xLJvlkFUxmFz1Zdoqi1e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hf4KMFy6SV6gZd4EjaOypPWL12ZdzroUczVL0OAdXVPITlH1hx0mfuBOb3a/S/cZK iRTbh/8j+sObG5QG8YxOlBW7ciEpV36R1eNoOGY+1VaNs4s4qy46sMRVATNBdSfCjQ t+qfBu5fOo6sXgXvOncdPGvJBRPi/Y0MpKRs2QJI= 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.8 280/633] coresight: etm: perf: Fix warning caused by etm_setup_aux failure Date: Tue, 27 Oct 2020 14:50:23 +0100 Message-Id: <20201027135535.807205476@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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