[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1435574617.11963.0.camel@neuling.org>
Date: Mon, 29 Jun 2015 20:43:37 +1000
From: Michael Neuling <mikey@...ling.org>
To: Maninder Singh <maninder1.s@...sung.com>
Cc: imunsie@....ibm.com, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, pankaj.m@...sung.com
Subject: Re: [PATCH 1/1] cxl/vphb.c: Use phb pointer after NULL check
On Mon, 2015-06-29 at 16:05 +0530, Maninder Singh wrote:
> static Anlaysis detected below error:-
> (error) Possible null pointer dereference: phb
>
> So, Use phb after NULL check.
>
> Signed-off-by: Maninder Singh <maninder1.s@...sung.com>
Thanks, looks good.
Acked-By: Michael Neuling <mikey@...ling.org>
> ---
> drivers/misc/cxl/vphb.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c
> index b1d1983a..2eba002 100644
> --- a/drivers/misc/cxl/vphb.c
> +++ b/drivers/misc/cxl/vphb.c
> @@ -112,9 +112,10 @@ static int cxl_pcie_config_info(struct pci_bus *bus, unsigned int devfn,
> unsigned long addr;
>
> phb = pci_bus_to_host(bus);
> - afu = (struct cxl_afu *)phb->private_data;
> if (phb == NULL)
> return PCIBIOS_DEVICE_NOT_FOUND;
> + afu = (struct cxl_afu *)phb->private_data;
> +
> if (cxl_pcie_cfg_record(bus->number, devfn) > afu->crs_num)
> return PCIBIOS_DEVICE_NOT_FOUND;
> if (offset >= (unsigned long)phb->cfg_data)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists