Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1347427 > unrolled thread

[PATCH 4.4 125/342] coresight: checking for NULL string in coresight_name_match()

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2016-03-02 02:20 +0100
Last post2016-03-02 02:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4.4 125/342] coresight: checking for NULL string in coresight_name_match() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2016-03-02 02:20 +0100

#1347427 — [PATCH 4.4 125/342] coresight: checking for NULL string in coresight_name_match()

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2016-03-02 02:20 +0100
Subject[PATCH 4.4 125/342] coresight: checking for NULL string in coresight_name_match()
Message-ID<r83Ch-jE-15@gated-at.bofh.it>
4.4-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mathieu Poirier <mathieu.poirier@linaro.org>

commit fadf3a44e974b030e7145218ad1ab25e3ef91738 upstream.

Connection child names associated to ports can sometimes be NULL,
which is the case when booting a system on QEMU or when the Coresight
power domain isn't switched on.

This patch is adding a check to make sure a NULL string isn't fed
to strcmp(), something that avoid crashing the system.

Reported-by: Tyler Baker <tyler.baker@linaro.org>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/hwtracing/coresight/coresight.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/hwtracing/coresight/coresight.c
+++ b/drivers/hwtracing/coresight/coresight.c
@@ -548,7 +548,7 @@ static int coresight_name_match(struct d
 	to_match = data;
 	i_csdev = to_coresight_device(dev);
 
-	if (!strcmp(to_match, dev_name(&i_csdev->dev)))
+	if (to_match && !strcmp(to_match, dev_name(&i_csdev->dev)))
 		return 1;
 
 	return 0;

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web