summaryrefslogtreecommitdiffstats
path: root/drivers/hwtracing
diff options
context:
space:
mode:
authorMathieu Poirier <mathieu.poirier@linaro.org>2015-12-17 16:47:02 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-12-21 22:31:31 +0100
commitfadf3a44e974b030e7145218ad1ab25e3ef91738 (patch)
tree284865baafd4c8bb1c9d8a5822b4d117536198d6 /drivers/hwtracing
parentDrivers: hv: vmbus: Treat Fibre Channel devices as performance critical (diff)
downloadlinux-fadf3a44e974b030e7145218ad1ab25e3ef91738.tar.xz
linux-fadf3a44e974b030e7145218ad1ab25e3ef91738.zip
coresight: checking for NULL string in coresight_name_match()
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. Cc: <stable@vger.kernel.org> # v3.18+ 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>
Diffstat (limited to 'drivers/hwtracing')
-rw-r--r--drivers/hwtracing/coresight/coresight.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c
index e25492137d8b..93738dfbf631 100644
--- a/drivers/hwtracing/coresight/coresight.c
+++ b/drivers/hwtracing/coresight/coresight.c
@@ -548,7 +548,7 @@ static int coresight_name_match(struct device *dev, void *data)
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;