From: Bjorn Helgaas <bhelgaas@google.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Marta Rybczynska <rybczynska@gmail.com>,
linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pci: hotplug: cpqphp_ctrl.c: Fix for possible null pointer dereference
Date: Tue, 27 May 2014 20:57:53 -0600 [thread overview]
Message-ID: <20140528025753.GM11907@google.com> (raw)
In-Reply-To: <1400428977-10464-1-git-send-email-rickard_strandqvist@spectrumdigital.se>
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@spectrumdigital.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
>
prev parent reply other threads:[~2014-05-28 2:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-18 16:02 [PATCH] pci: hotplug: cpqphp_ctrl.c: Fix for possible null pointer dereference Rickard Strandqvist
2014-05-28 2:57 ` Bjorn Helgaas [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140528025753.GM11907@google.com \
--to=bhelgaas@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=rybczynska@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.