powerpc/powernv/eeh/npu: Fix uninitialized variables in opal_pci_eeh_freeze_status
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Mon, 19 Nov 2018 04:25:17 +0000 (15:25 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2019 14:37:43 +0000 (15:37 +0100)
[ Upstream commit c20577014f85f36d4e137d3d52a1f61225b4a3d2 ]

The current implementation of the OPAL_PCI_EEH_FREEZE_STATUS call in
skiboot's NPU driver does not touch the pci_error_type parameter so
it might have garbage but the powernv code analyzes it nevertheless.

This initializes pcierr and fstate to zero in all call sites.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Sam Bobroff <sbobroff@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/powernv/eeh-powernv.c
arch/powerpc/platforms/powernv/pci-ioda.c
arch/powerpc/platforms/powernv/pci.c

index 8864065eba227cf9b8f9972f8adff00f842b639f..fa2965c96155b4111152d24cef452dc2d4e080de 100644 (file)
@@ -548,8 +548,8 @@ static void pnv_eeh_get_phb_diag(struct eeh_pe *pe)
 static int pnv_eeh_get_phb_state(struct eeh_pe *pe)
 {
        struct pnv_phb *phb = pe->phb->private_data;
-       u8 fstate;
-       __be16 pcierr;
+       u8 fstate = 0;
+       __be16 pcierr = 0;
        s64 rc;
        int result = 0;
 
@@ -587,8 +587,8 @@ static int pnv_eeh_get_phb_state(struct eeh_pe *pe)
 static int pnv_eeh_get_pe_state(struct eeh_pe *pe)
 {
        struct pnv_phb *phb = pe->phb->private_data;
-       u8 fstate;
-       __be16 pcierr;
+       u8 fstate = 0;
+       __be16 pcierr = 0;
        s64 rc;
        int result;
 
index ddef22e00ddd74e84e38ec2c6ec2193e36741112..d3d5796f7df603da10143e87d40d1069eacc3f42 100644 (file)
@@ -598,8 +598,8 @@ static int pnv_ioda_unfreeze_pe(struct pnv_phb *phb, int pe_no, int opt)
 static int pnv_ioda_get_pe_state(struct pnv_phb *phb, int pe_no)
 {
        struct pnv_ioda_pe *slave, *pe;
-       u8 fstate, state;
-       __be16 pcierr;
+       u8 fstate = 0, state;
+       __be16 pcierr = 0;
        s64 rc;
 
        /* Sanity check on PE number */
index 5422f4a6317cadf06335c4c1a18e3d7dcccd6db6..e2d031a3ec1577f4b28e13733f112af52e09a9cc 100644 (file)
@@ -600,8 +600,8 @@ static void pnv_pci_handle_eeh_config(struct pnv_phb *phb, u32 pe_no)
 static void pnv_pci_config_check_eeh(struct pci_dn *pdn)
 {
        struct pnv_phb *phb = pdn->phb->private_data;
-       u8      fstate;
-       __be16  pcierr;
+       u8      fstate = 0;
+       __be16  pcierr = 0;
        unsigned int pe_no;
        s64     rc;