From: Yemingxuan <level_zero@qq.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rafael J. Wysocki <rafael@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] drivers/base: return bus_add_driver() errors
Date: Tue, 20 Oct 2026 15:19:20 +0800 [thread overview]
Message-ID: <tencent_56AB3AF14CC0D56366D5E66461ECDF324A05@qq.com> (raw)
In-Reply-To: <2026102017-irate-stalling-aba6@gregkh>
Hi Greg,
Thanks for the review.
> Full name?
My full name is Ye Mingxuan; I had it in the From: line as a single
latinised word. I will use the full form from now on.
> Are you sure that this is going to work properly? How was this tested?
You're right to ask. It has not been tested at runtime, only built and
checked with checkpatch. I looked at the three failure modes again and
that is where the real problem is:
- -EINVAL is unreachable: driver_ktype always supplies sysfs_ops, so
sysfs_add_file_mode_ns() can never reject the attribute on that
ground.
- -EEXIST needs an in-tree bus whose drv_groups collides with the
built-in uevent, bind or unbind attribute. None of the eight buses
that define drv_groups do.
- -ENOMEM would need an allocation failure at exactly that point in
boot.
So there is no way for me to construct the situation this patch is
supposed to handle, which also means I cannot show that the unwind is
correct.
> That comment is a good indication that no one will hit this, so why
> even worry about any of this?
Agreed. I read that comment as "the author gave up on the error path",
but you are right that it says more about how reachable the path is than
about whether it is handled. With -EINVAL and -EEXIST both ruled out and
-ENOMEM being a boot-time allocation failure, changing the error handling
here buys nothing that anyone can observe, and it does add a return path
that was never exercised.
Please drop this patch. Sorry for the noise.
Ye Mingxuan
prev parent reply other threads:[~2026-10-20 7:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 6:31 Yemingxuan
2026-10-20 6:48 ` Greg Kroah-Hartman
2026-10-20 7:19 ` Yemingxuan [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=tencent_56AB3AF14CC0D56366D5E66461ECDF324A05@qq.com \
--to=level_zero@qq.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@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 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®