From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: "Cavitt, Jonathan" <jonathan.cavitt@intel.com>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Cc: "De Marchi, Lucas" <lucas.demarchi@intel.com>
Subject: Re: [PATCH 1/5] drm/xe/configfs: Fix pci_dev reference leak
Date: Fri, 18 Jul 2025 10:58:25 +0200 [thread overview]
Message-ID: <83826115-1846-433f-b087-a695faf3d0fc@intel.com> (raw)
In-Reply-To: <CH0PR11MB5444593FFB130CD1644E3244E551A@CH0PR11MB5444.namprd11.prod.outlook.com>
On 17.07.2025 23:16, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Michal Wajdeczko
> Sent: Thursday, July 17, 2025 11:48 AM
> To: intel-xe@lists.freedesktop.org
> Cc: Wajdeczko, Michal <Michal.Wajdeczko@intel.com>; De Marchi, Lucas <lucas.demarchi@intel.com>
> Subject: [PATCH 1/5] drm/xe/configfs: Fix pci_dev reference leak
>>
>> We are using pci_get_domain_bus_and_slot() function to verify if
>> the given config directory name matches any existing PCI device,
>> but we missed to call matching pci_dev_put() to release reference.
>>
>> While around, also change error code in case of no device match,
>> to make it more specific than generic formatting error.
>>
>> Fixes: 16280ded45fb ("drm/xe: Add configfs to enable survivability mode")
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
>
> Since we're already being fairly granular with the changes in this patch series,
> it probably would've been okay for us to separate the pci_dev_put addition
> from the errno change here.
while we could split this small patch even further, note that changes
are still around the same logical feature ("check for existing PCI
device") so IMO combining them in single patch is still ok (and since it
has Fixes tag we have a chance to propagate both together)
> But I won't make it a requirement.
hint: usually such comments are then prefixed with "nit:" to make it
clear that comment is just a suggestion or personal preference
>
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> -Jonathan Cavitt
>
>> ---
>> drivers/gpu/drm/xe/xe_configfs.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_configfs.c b/drivers/gpu/drm/xe/xe_configfs.c
>> index 8ec1ff1e4e80..e9b46a2d0019 100644
>> --- a/drivers/gpu/drm/xe/xe_configfs.c
>> +++ b/drivers/gpu/drm/xe/xe_configfs.c
>> @@ -267,7 +267,8 @@ static struct config_group *xe_config_make_device_group(struct config_group *gro
>>
>> pdev = pci_get_domain_bus_and_slot(domain, bus, PCI_DEVFN(slot, function));
>> if (!pdev)
>> - return ERR_PTR(-EINVAL);
>> + return ERR_PTR(-ENODEV);
>> + pci_dev_put(pdev);
>>
>> dev = kzalloc(sizeof(*dev), GFP_KERNEL);
>> if (!dev)
>> --
>> 2.47.1
>>
>>
next prev parent reply other threads:[~2025-07-18 8:58 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-17 18:48 [PATCH 0/5] Updates for drm/xe/configfs Michal Wajdeczko
2025-07-17 18:48 ` [PATCH 1/5] drm/xe/configfs: Fix pci_dev reference leak Michal Wajdeczko
2025-07-17 19:35 ` Lucas De Marchi
2025-07-17 21:16 ` Cavitt, Jonathan
2025-07-18 8:58 ` Michal Wajdeczko [this message]
2025-07-17 18:48 ` [PATCH 2/5] drm/xe/configfs: Enforce canonical device names Michal Wajdeczko
2025-07-17 19:43 ` Lucas De Marchi
2025-07-17 20:27 ` Michal Wajdeczko
2025-07-17 21:17 ` Cavitt, Jonathan
2025-07-18 9:06 ` Michal Wajdeczko
2025-07-18 14:16 ` Cavitt, Jonathan
2025-07-18 14:05 ` [PATCH v2 " Michal Wajdeczko
2025-07-18 20:52 ` Lucas De Marchi
2025-07-17 18:48 ` [PATCH 3/5] drm/xe/configfs: Use pci_name() for lookup Michal Wajdeczko
2025-07-17 19:44 ` Lucas De Marchi
2025-07-17 21:18 ` Cavitt, Jonathan
2025-07-18 9:23 ` Michal Wajdeczko
2025-07-17 18:48 ` [PATCH 4/5] drm/xe/configfs: Allow configurations only for Intel VGA devices Michal Wajdeczko
2025-07-17 19:52 ` Lucas De Marchi
2025-07-17 20:51 ` Michal Wajdeczko
2025-07-18 21:02 ` Lucas De Marchi
2025-07-17 21:19 ` Cavitt, Jonathan
2025-07-18 9:29 ` Michal Wajdeczko
2025-07-18 14:27 ` Cavitt, Jonathan
2025-07-18 14:33 ` Michal Wajdeczko
2025-07-18 17:28 ` Cavitt, Jonathan
2025-07-18 14:17 ` [PATCH v2 " Michal Wajdeczko
2025-07-17 18:48 ` [PATCH 5/5] drm/xe/configfs: Allow adding configurations for future VFs Michal Wajdeczko
2025-07-17 21:19 ` Cavitt, Jonathan
2025-07-17 19:06 ` ✓ CI.KUnit: success for Updates for drm/xe/configfs Patchwork
2025-07-17 20:13 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-18 14:23 ` ✓ CI.KUnit: success for Updates for drm/xe/configfs (rev3) Patchwork
2025-07-18 15:15 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-19 7:47 ` ✗ Xe.CI.Full: failure for Updates for drm/xe/configfs Patchwork
2025-07-21 10:53 ` ✗ Xe.CI.Full: failure for Updates for drm/xe/configfs (rev3) Patchwork
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=83826115-1846-433f-b087-a695faf3d0fc@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
--cc=lucas.demarchi@intel.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