From: Shuah Khan <skhan@linuxfoundation.org>
To: Chen Zhongjin <chenzhongjin@huawei.com>,
linux-kernel@vger.kernel.org, linux-media@vger.kernel.org
Cc: kieran.bingham@ideasonboard.com, mchehab@kernel.org,
hans.verkuil@cisco.com, helen.koike@collabora.com,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] media: vimc: Fix wrong function called when vimc_init() fails
Date: Thu, 10 Nov 2022 09:56:21 -0700 [thread overview]
Message-ID: <fa8b6690-5560-7feb-7616-db636161e204@linuxfoundation.org> (raw)
In-Reply-To: <20221110072633.210437-1-chenzhongjin@huawei.com>
On 11/10/22 00:26, Chen Zhongjin wrote:
> 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>
> ---
> drivers/media/test-drivers/vimc/vimc-core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
> }
>
Good catch. Thanks for fixing it. Now applied for next rc.
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux.git/?h=vimc
thanks,
-- Shuah
prev parent reply other threads:[~2022-11-10 16:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 7:26 Chen Zhongjin
2022-11-10 16:56 ` Shuah Khan [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fa8b6690-5560-7feb-7616-db636161e204@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=chenzhongjin@huawei.com \
--cc=hans.verkuil@cisco.com \
--cc=helen.koike@collabora.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®