[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140528025753.GM11907@google.com>
Date: Tue, 27 May 2014 20:57:53 -0600
From: Bjorn Helgaas <bhelgaas@...gle.com>
To: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Marta Rybczynska <rybczynska@...il.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pci: hotplug: cpqphp_ctrl.c: Fix for possible null
pointer dereference
On Sun, May 18, 2014 at 06:02:57PM +0200, Rickard Strandqvist wrote:
> There is otherwise a risk of a possible null pointer dereference.
>
> Was largely found by using a static code analysis program called cppcheck.
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
Applied to pci/hotplug for v3.16, thanks!
> ---
> drivers/pci/hotplug/cpqphp_ctrl.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pci/hotplug/cpqphp_ctrl.c b/drivers/pci/hotplug/cpqphp_ctrl.c
> index 11845b7..a319d07 100644
> --- a/drivers/pci/hotplug/cpqphp_ctrl.c
> +++ b/drivers/pci/hotplug/cpqphp_ctrl.c
> @@ -709,7 +709,8 @@ static struct pci_resource *get_max_resource(struct pci_resource **head, u32 siz
> temp = temp->next;
> }
>
> - temp->next = max->next;
> + if(temp)
> + temp->next = max->next;
> }
>
> max->next = NULL;
> --
> 1.7.10.4
>
--
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