mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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: <[email protected]> # v3.18+ Reported-by: Tyler Baker <[email protected]> Signed-off-by: Mathieu Poirier <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
879a650a27
commit
fadf3a44e9
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue