From 81a78cf1d051e5de8687995864a9a135895ceb95 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Wed, 13 Nov 2019 13:52:39 +0100 Subject: [PATCH] usb_host_drv: fix 'matches->compatible' string access Fixes #3582 --- repos/dde_linux/src/drivers/usb_host/lx_emul.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/repos/dde_linux/src/drivers/usb_host/lx_emul.cc b/repos/dde_linux/src/drivers/usb_host/lx_emul.cc index e9cadbc76..d32972264 100644 --- a/repos/dde_linux/src/drivers/usb_host/lx_emul.cc +++ b/repos/dde_linux/src/drivers/usb_host/lx_emul.cc @@ -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;