Skip to content

Commit e4cb293

Browse files
ij-intelbjorn-helgaas
authored andcommitted
PCI: Do not claim to release resource falsely
pci_release_resource() will print "... releasing" regardless of the resource being assigned or not. Move the print after the res->parent check to avoid claiming the kernel would be releasing an unassigned resource. Likely, none of the current callers pass a resource that is unassigned so this change is mostly to correct the non-sensical order than to remove errorneous printouts. Link: https://lore.kernel.org/r/20250307140922.5776-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
1 parent 5af4739 commit e4cb293

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/pci/setup-res.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,11 +411,11 @@ void pci_release_resource(struct pci_dev *dev, int resno)
411411
struct resource *res = pci_resource_n(dev, resno);
412412
const char *res_name = pci_resource_name(dev, resno);
413413

414-
pci_info(dev, "%s %pR: releasing\n", res_name, res);
415-
416414
if (!res->parent)
417415
return;
418416

417+
pci_info(dev, "%s %pR: releasing\n", res_name, res);
418+
419419
release_resource(res);
420420
res->end = resource_size(res) - 1;
421421
res->start = 0;

0 commit comments

Comments
 (0)