coresight: checking for NULL string in coresight_name_match()
authorMathieu Poirier <mathieu.poirier@linaro.org>
Thu, 17 Dec 2015 15:47:02 +0000 (08:47 -0700)
committerMathieu Poirier <mathieu.poirier@linaro.org>
Wed, 1 Jun 2016 21:29:58 +0000 (15:29 -0600)
commitb746b9cf2f52aa7a572b8be2b1718966b65f14a1
treeca3e7a90389db4d6eb8d2e2df1b9d858489515ab
parente05ed3268032a6c0dc677558fb82afb046dd638f
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>
(cherry picked from commit fadf3a44e974b030e7145218ad1ab25e3ef91738)
drivers/hwtracing/coresight/coresight.c