All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: bjorn.helgaas@hp.com
Cc: linux-acpi@vger.kernel.org
Subject: re: PNPACPI: add support for HP vendor-specific CCSR descriptors
Date: Mon, 25 Jan 2016 21:31:44 +0300	[thread overview]
Message-ID: <20160125183144.GA25673@mwanda> (raw)

Hello Bjorn Helgaas,

The patch 40ab4f4c1d84: "PNPACPI: add support for HP vendor-specific
CCSR descriptors" from Jun 27, 2008, leads to the following static
checker warning:

	drivers/pnp/pnpacpi/rsparser.c:170 pnpacpi_parse_allocated_vendor()
	error: __memcpy() 'vendor->byte_data' too small (1 vs 8)

drivers/pnp/pnpacpi/rsparser.c
   164  static void pnpacpi_parse_allocated_vendor(struct pnp_dev *dev,
   165                                      struct acpi_resource_vendor_typed *vendor)
   166  {
   167          if (vendor_resource_matches(dev, vendor, &hp_ccsr_uuid, 16)) {
   168                  u64 start, length;
   169  
   170                  memcpy(&start, vendor->byte_data, sizeof(start));
                                       ^^^^^^^^^^^^^^^^^
This is only 1 byte follow by 7 bytes of data we didn't want.

   171                  memcpy(&length, vendor->byte_data + 8, sizeof(length));
   172  
   173                  pnp_add_mem_resource(dev, start, start + length - 1, 0);
   174          }
   175  }

regards,
dan carpenter

                 reply	other threads:[~2016-01-25 18:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20160125183144.GA25673@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-acpi@vger.kernel.org \
    /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.