Skip to content

Commit 2075ec9

Browse files
oohalmpe
authored andcommitted
powerpc/powernv/sriov: Fix use of uninitialised variable
Initialising the value before using it is generally regarded as a good idea so do that. Fixes: 4c51f3e ("powerpc/powernv/sriov: Make single PE mode a per-BAR setting") Reported-by: Nathan Chancellor <[email protected]> Signed-off-by: Oliver O'Halloran <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 872d11b commit 2075ec9

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

arch/powerpc/platforms/powernv/pci-sriov.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,9 +253,9 @@ void pnv_pci_ioda_fixup_iov(struct pci_dev *pdev)
253253
resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
254254
int resno)
255255
{
256+
resource_size_t align = pci_iov_resource_size(pdev, resno);
256257
struct pnv_phb *phb = pci_bus_to_pnvhb(pdev->bus);
257258
struct pnv_iov_data *iov = pnv_iov_get(pdev);
258-
resource_size_t align;
259259

260260
/*
261261
* iov can be null if we have an SR-IOV device with IOV BAR that can't
@@ -266,8 +266,6 @@ resource_size_t pnv_pci_iov_resource_alignment(struct pci_dev *pdev,
266266
if (!iov)
267267
return align;
268268

269-
align = pci_iov_resource_size(pdev, resno);
270-
271269
/*
272270
* If we're using single mode then we can just use the native VF BAR
273271
* alignment. We validated that it's possible to use a single PE

0 commit comments

Comments
 (0)