From: Jiri Slaby <jirislaby@kernel.org>
To: Tony Lindgren <tony@atomide.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: "Andy Shevchenko" <andriy.shevchenko@intel.com>,
"Dhruva Gole" <d-gole@ti.com>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
"John Ogness" <john.ogness@linutronix.de>,
"Johan Hovold" <johan@kernel.org>,
"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>,
"Vignesh Raghavendra" <vigneshr@ti.com>,
linux-omap@vger.kernel.org, linux-serial@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] serial: core: Fix error handling for serial_core_ctrl_device_add()
Date: Fri, 2 Jun 2023 08:48:19 +0200 [thread overview]
Message-ID: <ca22d4ad-fd07-2733-a4c4-e6ed9c5ebe3f@kernel.org> (raw)
In-Reply-To: <20230602064652.GF14287@atomide.com>
On 02. 06. 23, 8:46, Tony Lindgren wrote:
> * Tony Lindgren <tony@atomide.com> [230602 06:41]:
>> Checking for NULL is not enough as serial_base_ctrl_add() uses ERR_PTR().
>>
>> Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>> ---
>> drivers/tty/serial/serial_core.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
>> --- a/drivers/tty/serial/serial_core.c
>> +++ b/drivers/tty/serial/serial_core.c
>> @@ -3342,7 +3342,7 @@ int serial_core_register_port(struct uart_driver *drv, struct uart_port *port)
>> ctrl_dev = serial_core_ctrl_find(drv, port->dev, port->ctrl_id);
>> if (!ctrl_dev) {
>> new_ctrl_dev = serial_core_ctrl_device_add(port);
>> - if (!new_ctrl_dev) {
>> + if (IS_ERR_OR_NULL(new_ctrl_dev)) {
>> ret = -ENODEV;
>> goto err_unlock;
>> }
>
> Hmm actually we should also change to use ret = PTR_ERR(new_ctrl_dev) here
> instead of translating all the errors to -ENODEV. Will send out v2 version.
Why OR_NULL at all, actually?
--
js
suse labs
next prev parent reply other threads:[~2023-06-02 6:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-02 6:41 [PATCH] serial: core: Fix error handling for serial_core_ctrl_device_add() Tony Lindgren
2023-06-02 6:46 ` Tony Lindgren
2023-06-02 6:48 ` Jiri Slaby [this message]
2023-06-02 6:51 ` Tony Lindgren
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=ca22d4ad-fd07-2733-a4c4-e6ed9c5ebe3f@kernel.org \
--to=jirislaby@kernel.org \
--cc=andriy.shevchenko@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=bigeasy@linutronix.de \
--cc=d-gole@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=johan@kernel.org \
--cc=john.ogness@linutronix.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=tony@atomide.com \
--cc=vigneshr@ti.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 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.