From: Rihyeon Kim <rihyeon8648@gmail.com>
To: "Krzysztof Wilczyński" <kwilczynski@kernel.org>
Cc: bhelgaas@google.com, linux-pci@vger.kernel.org,
linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org,
tarunsahu@google.com, djeffery@redhat.com
Subject: Re: [PATCH] PCI: Handle dev_set_name() failure in pci_setup_device()
Date: Sun, 26 Jul 2026 18:31:27 +0900 [thread overview]
Message-ID: <20260726093127.145865-1-rihyeon8648@gmail.com> (raw)
In-Reply-To: <20260725180429.GA349362@rocinante>
Hello,
Thanks a lot for the review.
> The kernel-doc for pci_setup_device() will probably need to be updated to
> reflect changes in what the function returns on failure, since now you have
> the -EIO and also -ENOMEM, potentially.
Good point, I missed that. Updated in v2.
> Probably:
>
> Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array")
>
> The commit you have references a state of the code, a much older code base,
> where the implementation was fundamentally different, per:
You are right, thanks. I had missed that dev_set_name() could not fail at
all back then, and that the commit I picked was only replacing an snprintf()
into the same fixed array. Both patches in v2 use 1fa5ae857bb1 now, and the
commit log says kvasprintf_const().
> The fix there is valid and would be nice to also pick it up. Might use
> a little...
>
> dev->dev.kobj.name = NULL;
>
> After the kfree_const().
>
> Feel free to pick it up, and include here as a second patch, so a small
> series. Don't forget to credit Yang Yingliang, if you do decide to
> follow-up.
Thanks for the suggestion. It is patch 2/2 in v2, with the NULL assignment
as you described, and with Suggested-by: and a Link: to Yang Yingliang's
original posting.
> This one I am not sure. The NULL-assignment move looks awkward there.
Agreed, I left pci_device_add() alone. It also overlaps with the driver
core series that changes when device_add() frees dev->p [1], so I would
rather wait and see how that one settles before proposing anything there.
If it still looks worth doing afterwards, I can revisit it then.
[1] https://lore.kernel.org/all/20260716230411.2767394-2-tarunsahu@google.com/
Thanks again,
Rihyeon
prev parent reply other threads:[~2026-07-26 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 10:47 Rihyeon Kim
2026-07-25 19:19 ` Krzysztof Wilczyński
2026-07-26 9:31 ` Rihyeon Kim [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=20260726093127.145865-1-rihyeon8648@gmail.com \
--to=rihyeon8648@gmail.com \
--cc=bhelgaas@google.com \
--cc=djeffery@redhat.com \
--cc=gregkh@linuxfoundation.org \
--cc=kwilczynski@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=tarunsahu@google.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®