diff options
| author | Yuan Can <[email protected]> | 2022-11-11 06:09:26 +0000 |
|---|---|---|
| committer | Hans Verkuil <[email protected]> | 2022-11-18 15:48:17 +0100 |
| commit | a95cc6d11aae16a7b2d043b073a40de81bbea689 (patch) | |
| tree | 104a4bfb015aba6f650167f47ea9bb3de74b5961 /tools/perf/scripts/python/export-to-postgresql.py | |
| parent | b434422c45282a0573d8123239abc41fa72665d4 (diff) | |
media: amphion: Fix error handling in vpu_driver_init()
A problem about modprobe amphion-vpu failed is triggered with the
following log given:
[ 2208.634841] Error: Driver 'amphion-vpu' is already registered, aborting...
modprobe: ERROR: could not insert 'amphion_vpu': Device or resource busy
The reason is that vpu_driver_init() returns vpu_core_driver_init()
directly without checking its return value, if vpu_core_driver_init()
failed, it returns without unregister amphion_vpu_driver, resulting the
amphion-vpu can never be installed later.
A simple call graph is shown as below:
vpu_driver_init()
platform_driver_register() # register amphion_vpu_driver
vpu_core_driver_init()
platform_driver_register()
driver_register()
bus_add_driver()
dev = kzalloc(...) # OOM happened
# return without unregister amphion_vpu_driver
Fix by unregister amphion_vpu_driver when vpu_core_driver_init() returns
error.
Fixes: b50a64fc54af ("media: amphion: add amphion vpu device driver")
Signed-off-by: Yuan Can <[email protected]>
Reviewed-by: ming_qian <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions