lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fa8b6690-5560-7feb-7616-db636161e204@linuxfoundation.org>
Date:   Thu, 10 Nov 2022 09:56:21 -0700
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Chen Zhongjin <chenzhongjin@...wei.com>,
        linux-kernel@...r.kernel.org, linux-media@...r.kernel.org
Cc:     kieran.bingham@...asonboard.com, mchehab@...nel.org,
        hans.verkuil@...co.com, helen.koike@...labora.com,
        Shuah Khan <skhan@...uxfoundation.org>
Subject: Re: [PATCH] media: vimc: Fix wrong function called when vimc_init()
 fails

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ