usb_host_drv: fix 'matches->compatible' string access

Fixes #3582
This commit is contained in:
Christian Prochaska 2019-11-13 13:52:39 +01:00 committed by Christian Helmuth
parent 283135c9cd
commit 81a78cf1d0
1 changed files with 1 additions and 1 deletions

View File

@ -1035,7 +1035,7 @@ const struct of_device_id *of_match_device(const struct of_device_id *matches,
const struct device *dev)
{
const char * compatible = (const char*) of_get_property(dev->of_node, "compatible", 0);
for (; matches && matches->compatible; matches++)
for (; matches && matches->compatible[0]; matches++)
if (Genode::strcmp(matches->compatible, compatible) == 0)
return matches;
return nullptr;