Commit 5666a27
committed
driver core: fix driver_set_override() issue with empty strings
Python likes to send an empty string for some sysfs files, including the
driver_override field. When commit 23d99ba ("PCI: Use
driver_set_override() instead of open-coding") moved the PCI core to use
the driver core function instead of hand-rolling their own handler, this
showed up as a regression from some userspace tools, like DPDK.
Fix this up by actually looking at the length of the string first
instead of trusting that userspace got it correct.
Fixes: 23d99ba ("PCI: Use driver_set_override() instead of open-coding")
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Bjorn Helgaas <[email protected]>
Cc: "Rafael J. Wysocki" <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: stable <[email protected]>
Reported-by: Stephen Hemminger <[email protected]>
Tested-by: Huisong Li <[email protected]>
Reviewed-by: Stephen Hemminger <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>1 parent c749b27 commit 5666a27
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
66 | 72 | | |
67 | 73 | | |
68 | 74 | | |
| |||
0 commit comments