linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: 13145886936@163.com
To: tglx@linutronix.de, bp@alien8.de, x86@kernel.org
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	gushengxian <gushengxian@yulong.com>
Subject: [PATCH] x86: eas should not be NULL when it is referenced
Date: Thu, 24 Jun 2021 00:04:42 -0700	[thread overview]
Message-ID: <20210624070442.34291-1-13145886936@163.com> (raw)

From: gushengxian <gushengxian@yulong.com>

"eas" should not be NULL when it is referenced.

Signed-off-by: gushengxian <gushengxian@yulong.com>
---
 arch/x86/events/intel/uncore_snbep.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
index bb6eb1e5569c..836aa78cd0f3 100644
--- a/arch/x86/events/intel/uncore_snbep.c
+++ b/arch/x86/events/intel/uncore_snbep.c
@@ -3826,8 +3826,10 @@ pmu_iio_set_mapping(struct intel_uncore_type *type, struct attribute_group *ag)
 
 	return 0;
 err:
-	for (; die >= 0; die--)
-		kfree(eas[die].attr.attr.name);
+	if (eas) {
+		for (; die >= 0; die--)
+			kfree(eas[die].attr.attr.name);
+	}
 	kfree(eas);
 	kfree(attrs);
 	kfree(type->topology);
-- 
2.25.1



             reply	other threads:[~2021-06-24  7:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-24  7:04 13145886936 [this message]
2021-06-24  7:24 ` Peter Zijlstra
2021-06-24 19:03 ` Liang, Kan
2021-06-24 19:06   ` Liang, Kan
2021-06-25 13:33     ` Alexander Antonov
2021-06-25 14:11       ` Liang, Kan
2021-06-25 14:26         ` Alexander Antonov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210624070442.34291-1-13145886936@163.com \
    --to=13145886936@163.com \
    --cc=bp@alien8.de \
    --cc=gushengxian@yulong.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --subject='Re: [PATCH] x86: eas should not be NULL when it is referenced' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).