From: Greg Kroah-Hartman Date: Thu, 12 Jan 2023 12:55:30 +0000 (+0100) Subject: 4.19-stable patches X-Git-Tag: v5.10.163~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83d63f387f32ab9fa7da88e06f4bcd18a9de2953;p=thirdparty%2Fkernel%2Fstable-queue.git 4.19-stable patches added patches: driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch --- diff --git a/queue-4.19/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch b/queue-4.19/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch new file mode 100644 index 00000000000..229cde5f054 --- /dev/null +++ b/queue-4.19/driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch @@ -0,0 +1,48 @@ +From 27c0d217340e47ec995557f61423ef415afba987 Mon Sep 17 00:00:00 2001 +From: "Isaac J. Manjarres" +Date: Tue, 20 Sep 2022 17:14:13 -0700 +Subject: driver core: Fix bus_type.match() error handling in __driver_attach() + +From: Isaac J. Manjarres + +commit 27c0d217340e47ec995557f61423ef415afba987 upstream. + +When a driver registers with a bus, it will attempt to match with every +device on the bus through the __driver_attach() function. Currently, if +the bus_type.match() function encounters an error that is not +-EPROBE_DEFER, __driver_attach() will return a negative error code, which +causes the driver registration logic to stop trying to match with the +remaining devices on the bus. + +This behavior is not correct; a failure while matching a driver to a +device does not mean that the driver won't be able to match and bind +with other devices on the bus. Update the logic in __driver_attach() +to reflect this. + +Fixes: 656b8035b0ee ("ARM: 8524/1: driver cohandle -EPROBE_DEFER from bus_type.match()") +Cc: stable@vger.kernel.org +Cc: Saravana Kannan +Signed-off-by: Isaac J. Manjarres +Link: https://lore.kernel.org/r/20220921001414.4046492-1-isaacmanjarres@google.com +Signed-off-by: Greg Kroah-Hartman +--- + drivers/base/dd.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +--- a/drivers/base/dd.c ++++ b/drivers/base/dd.c +@@ -911,8 +911,12 @@ static int __driver_attach(struct device + */ + return 0; + } else if (ret < 0) { +- dev_dbg(dev, "Bus failed to match device: %d", ret); +- return ret; ++ dev_dbg(dev, "Bus failed to match device: %d\n", ret); ++ /* ++ * Driver could not match with device, but may match with ++ * another device on the bus. ++ */ ++ return 0; + } /* ret > 0 means positive match */ + + if (dev->parent && dev->bus->need_parent_lock) diff --git a/queue-4.19/series b/queue-4.19/series index a2d60cbbc09..50889329c34 100644 --- a/queue-4.19/series +++ b/queue-4.19/series @@ -461,3 +461,4 @@ hfs-hfsplus-use-warn_on-for-sanity-check.patch hfs-hfsplus-avoid-warn_on-for-sanity-check-use-proper-error-handling.patch mbcache-avoid-nesting-of-cache-c_list_lock-under-bit-locks.patch parisc-align-parisc-madv_xxx-constants-with-all-other-architectures.patch +driver-core-fix-bus_type.match-error-handling-in-__driver_attach.patch