All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Hilst Selli <danielhilst@gmail.com>
To: "linux-c-programming@vger.kernel.org"
	<linux-c-programming@vger.kernel.org>
Subject: sizeof *data, when data isn't initalized, is that right?
Date: Thu, 22 Jan 2015 16:19:54 -0200	[thread overview]
Message-ID: <54C13F4A.2020404@gmail.com> (raw)

I came across this code:

         struct mcp23s08_driver_data     *data;
	...
	data = kzalloc(sizeof *data + chips * sizeof(struct mcp23s08),
                         GFP_KERNEL);


Since data wasn't initialized when `sizeof *data' is called, wasn't this a non-initialized pointer dereference?

Cheers

             reply	other threads:[~2015-01-22 18:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 18:19 Daniel Hilst Selli [this message]
2015-01-22 18:38 ` sizeof *data, when data isn't initalized, is that right? Hubert CHAUMETTE
2015-01-22 18:39 ` Hubert CHAUMETTE
2015-01-23  7:33   ` Trevor Woerner

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=54C13F4A.2020404@gmail.com \
    --to=danielhilst@gmail.com \
    --cc=linux-c-programming@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.