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: <f2df2547-3e11-7472-de15-645101944bde@gmail.com>
Date:   Fri, 26 Feb 2021 15:04:55 +0900
From:   Chanwoo Choi <cwchoi00@...il.com>
To:     Dinghao Liu <dinghao.liu@....edu.cn>, kjlu@....edu
Cc:     MyungJoo Ham <myungjoo.ham@...sung.com>,
        Chanwoo Choi <cw00.choi@...sung.com>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] extcon: Fix error handling in extcon_dev_register

Hi,

On 21. 1. 19. 오후 5:10, Dinghao Liu wrote:
> When devm_kcalloc() fails, we should execute device_unregister()
> to unregister edev->dev from system.
> 
> Fixes: 046050f6e623e ("extcon: Update the prototype of extcon_register_notifier() with enum extcon")
> Signed-off-by: Dinghao Liu <dinghao.liu@....edu.cn>
> ---
>   drivers/extcon/extcon.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c
> index 0a6438cbb3f3..e7a9561a826d 100644
> --- a/drivers/extcon/extcon.c
> +++ b/drivers/extcon/extcon.c
> @@ -1241,6 +1241,7 @@ int extcon_dev_register(struct extcon_dev *edev)
>   				sizeof(*edev->nh), GFP_KERNEL);
>   	if (!edev->nh) {
>   		ret = -ENOMEM;
> +		device_unregister(&edev->dev);
>   		goto err_dev;
>   	}
>   
> 

Thanks for fixup. Applied it.

Thanks,
Chanwoo Choi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ