diff options
author | Dan Carpenter <[email protected]> | 2023-06-14 09:36:33 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <[email protected]> | 2023-06-15 12:20:51 +0200 |
commit | cef09673c35bdffb0866268cedae5994e024ddb8 (patch) | |
tree | 7c480a318ad164775b93857b416bdea728b101cf /tools/perf/scripts/python/bin/export-to-postgresql-report | |
parent | 20a41a62618df85f3a2981008edec5cadd785e0a (diff) |
serial: core: fix -EPROBE_DEFER handling in init
The -EPROBE_DEFER error path in serial_base_device_init() is a bit
awkward. Before the call to device_initialize(dev) then we need to
manually release all the device resources. And after the call then we
need to call put_device() to release the resources. Doing either one
wrong will result in a leak or a use after free.
So let's wait to return -EPROBE_DEFER until after the call to
device_initialize(dev) so that way callers do not have to handle
-EPROBE_DEFER as a special case. Now callers can just use put_device()
for clean up.
The second issue with the -EPROBE_DEFER path is that deferring is not
supposed to be a fatal error, but instead it's normal part of the
init process and the kernel recovers from it automatically. That means
we should not print an error message but just a debug message on this
path.
Fixes: 539914240a01 ("serial: core: Fix probing serial_base_bus devices")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Tony Lindgren <[email protected]>
Message-ID: <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/export-to-postgresql-report')
0 files changed, 0 insertions, 0 deletions