[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YqiyUjCahmYG7bIa@kroah.com>
Date: Tue, 14 Jun 2022 18:07:46 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Zhi Song <zhi.song@...edance.com>
Cc: vilhelm.gray@...il.com, rafael@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] isa: put_device after failing to device_register
On Wed, Jun 15, 2022 at 12:01:26AM +0800, Zhi Song wrote:
> device_register() is used to register a device with the system.
> We need to call put_device() to give up the reference initialized
> in device_register() when it returns an error and this will clean
> up correctly.
>
> Signed-off-by: Zhi Song <zhi.song@...edance.com>
> ---
> drivers/base/isa.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/base/isa.c b/drivers/base/isa.c
> index 55e3ee2da98f..cf88f3d77b7d 100644
> --- a/drivers/base/isa.c
> +++ b/drivers/base/isa.c
> @@ -173,8 +173,10 @@ static int __init isa_bus_init(void)
> error = bus_register(&isa_bus_type);
> if (!error) {
> error = device_register(&isa_bus);
> - if (error)
> + if (error) {
> + put_device(&isa_bus);
> bus_unregister(&isa_bus_type);
> + }
> }
> return error;
> }
> --
> 2.30.2
>
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him
a patch that has triggered this response. He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created. Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.
You are receiving this message because of the following common error(s)
as indicated below:
- This looks like a new version of a previously submitted patch, but you
did not list below the --- line any changes from the previous version.
Please read the section entitled "The canonical patch format" in the
kernel file, Documentation/SubmittingPatches for what needs to be done
here to properly describe this.
If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.
thanks,
greg k-h's patch email bot
Powered by blists - more mailing lists