mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chanwoo Choi <cwchoi00@gmail.com>
To: Dinghao Liu <dinghao.liu@zju.edu.cn>, kjlu@umn.edu
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] extcon: Fix error handling in extcon_dev_register
Date: Fri, 26 Feb 2021 15:04:55 +0900	[thread overview]
Message-ID: <f2df2547-3e11-7472-de15-645101944bde@gmail.com> (raw)
In-Reply-To: <20210119081055.13207-1-dinghao.liu@zju.edu.cn>

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

      reply	other threads:[~2021-02-26  6:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-19  8:10 Dinghao Liu
2021-02-26  6:04 ` Chanwoo Choi [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=f2df2547-3e11-7472-de15-645101944bde@gmail.com \
    --to=cwchoi00@gmail.com \
    --cc=cw00.choi@samsung.com \
    --cc=dinghao.liu@zju.edu.cn \
    --cc=kjlu@umn.edu \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    /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®