git: 6bce8a35cf0a - main - usb(4): Check return value from bus_generic_get_device_path().

From: Hans Petter Selasky <hselasky_at_FreeBSD.org>
Date: Thu, 17 Mar 2022 14:29:57 UTC
The branch main has been updated by hselasky:

URL: https://cgit.FreeBSD.org/src/commit/?id=6bce8a35cf0aa184571e7e7049c1d15873afff30

commit 6bce8a35cf0aa184571e7e7049c1d15873afff30
Author:     Hans Petter Selasky <hselasky@FreeBSD.org>
AuthorDate: 2022-03-17 14:23:46 +0000
Commit:     Hans Petter Selasky <hselasky@FreeBSD.org>
CommitDate: 2022-03-17 14:27:50 +0000

    usb(4): Check return value from bus_generic_get_device_path().
    
    MFC after:              1 week
    Sponsored by:           NVIDIA Networking
---
 sys/dev/usb/usb_hub.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/dev/usb/usb_hub.c b/sys/dev/usb/usb_hub.c
index 6cd4cfd37ee4..1e5427a8bddd 100644
--- a/sys/dev/usb/usb_hub.c
+++ b/sys/dev/usb/usb_hub.c
@@ -1683,6 +1683,8 @@ uhub_get_device_path(device_t bus, device_t child, const char *locator,
 
 	if (strcmp(locator, BUS_LOCATOR_UEFI) == 0) {
 		rv = bus_generic_get_device_path(device_get_parent(bus), bus, locator, sb);
+		if (rv != 0)
+			return (rv);
 
 		sc = device_get_softc(bus);
 		hub = sc->sc_udev->hub;