linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <helgaas@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <lenb@kernel.org>, Bjorn Helgaas <bhelgaas@google.com>,
	linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] PCI: acpiphp_ibm: potential uninitialized variable bug
Date: Fri, 15 Apr 2016 10:34:22 -0500	[thread overview]
Message-ID: <20160415153422.GB7973@localhost> (raw)
In-Reply-To: <20160415145106.GH8953@mwanda>

On Fri, Apr 15, 2016 at 05:51:06PM +0300, Dan Carpenter wrote:
> If ibm_get_table_from_acpi() fails then "table" isn't initialized.  I
> fixed this by adding a check for failure.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied to pci/hotplug for v4.7, thanks, Dan!

> diff --git a/drivers/pci/hotplug/acpiphp_ibm.c b/drivers/pci/hotplug/acpiphp_ibm.c
> index 2f6d3a1..f6221d7 100644
> --- a/drivers/pci/hotplug/acpiphp_ibm.c
> +++ b/drivers/pci/hotplug/acpiphp_ibm.c
> @@ -138,6 +138,8 @@ static union apci_descriptor *ibm_slot_from_id(int id)
>  	char *table;
>  
>  	size = ibm_get_table_from_acpi(&table);
> +	if (size < 0)
> +		return NULL;
>  	des = (union apci_descriptor *)table;
>  	if (memcmp(des->header.sig, "aPCI", 4) != 0)
>  		goto ibm_slot_done;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-04-15 15:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-15 14:51 [patch] PCI: acpiphp_ibm: potential uninitialized variable bug Dan Carpenter
2016-04-15 15:34 ` 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=20160415153422.GB7973@localhost \
    --to=helgaas@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).