diff options
author | Chen Zhongjin <chenzhongjin@huawei.com> | 2022-11-10 07:26:33 +0000 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-11-25 07:26:16 +0000 |
commit | f74d3f326d1d5b8951ce263c59a121ecfa65e7c0 (patch) | |
tree | 2e62fbdcff0581437af20a00e94af9f035217521 /drivers/media/test-drivers/vimc | |
parent | 131823c4341feefa8cdc8fca024856e5fb4cfd74 (diff) | |
download | lwn-f74d3f326d1d5b8951ce263c59a121ecfa65e7c0.tar.gz lwn-f74d3f326d1d5b8951ce263c59a121ecfa65e7c0.zip |
media: vimc: Fix wrong function called when vimc_init() fails
In vimc_init(), when platform_driver_register(&vimc_pdrv) fails,
platform_driver_unregister(&vimc_pdrv) is wrongly called rather than
platform_device_unregister(&vimc_pdev), which causes kernel warning:
Unexpected driver unregister!
WARNING: CPU: 1 PID: 14517 at drivers/base/driver.c:270 driver_unregister+0x8f/0xb0
RIP: 0010:driver_unregister+0x8f/0xb0
Call Trace:
<TASK>
vimc_init+0x7d/0x1000 [vimc]
do_one_initcall+0xd0/0x4e0
do_init_module+0x1cf/0x6b0
load_module+0x65c2/0x7820
Fixes: 4a29b7090749 ("[media] vimc: Subdevices as modules")
Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/test-drivers/vimc')
-rw-r--r-- | drivers/media/test-drivers/vimc/vimc-core.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/test-drivers/vimc/vimc-core.c b/drivers/media/test-drivers/vimc/vimc-core.c index 2ae7a0f11ebf..e82cfa5ffbf4 100644 --- a/drivers/media/test-drivers/vimc/vimc-core.c +++ b/drivers/media/test-drivers/vimc/vimc-core.c @@ -433,7 +433,7 @@ static int __init vimc_init(void) if (ret) { dev_err(&vimc_pdev.dev, "platform driver registration failed (err=%d)\n", ret); - platform_driver_unregister(&vimc_pdrv); + platform_device_unregister(&vimc_pdev); return ret; } |