From: Tony Lindgren <tony@atomide.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
linux-serial@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] serial: core: fix -EPROBE_DEFER handling in init
Date: Wed, 14 Jun 2023 09:46:06 +0300 [thread overview]
Message-ID: <20230614064606.GH56720@atomide.com> (raw)
In-Reply-To: <18318adb-ab2c-4dcc-9f96-498a13d16b80@moroto.mountain>
* Dan Carpenter <dan.carpenter@linaro.org> [230614 06:36]:
> The -EPROBE_DEFER error path in serial_base_device_init() is a bit
> awkward. Before the call to device_initialize(dev) then we need to
> manually release all the device resources. And after the call then we
> need to call put_device() to release the resources. Doing either one
> wrong will result in a leak or a use after free.
>
> So let's wait to return -EPROBE_DEFER until after the call to
> device_initialize(dev) so that way callers do not have to handle
> -EPROBE_DEFER as a special case. Now callers can just use put_device()
> for clean up.
>
> The second issue with the -EPROBE_DEFER path is that deferring is not
> supposed to be a fatal error, but instead it's normal part of the
> init process and the kernel recovers from it automatically. That means
> we should not print an error message but just a debug message on this
> path.
>
> Fixes: 539914240a01 ("serial: core: Fix probing serial_base_bus devices")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Thanks for fixing these issues:
Reviewed-by: Tony Lindgren <tony@atomide.com>
prev parent reply other threads:[~2023-06-14 6:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-14 6:36 [PATCH] serial: core: fix -EPROBE_DEFER handling in init Dan Carpenter
2023-06-14 6:46 ` Tony Lindgren [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=20230614064606.GH56720@atomide.com \
--to=tony@atomide.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-serial@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.