linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Timur Tabi <timur@tabi.org>
To: David Laight <David.Laight@ACULAB.COM>,
	Nicolin Chen <b42378@freescale.com>,
	linuxppc-dev@lists.ozlabs.org, alsa-devel@alsa-project.org
Cc: broonie@kernel.org
Subject: Re: [PATCH] ASoC: fsl: expand the size of the name in fsl_ssi_private struct
Date: Thu, 23 May 2013 06:19:53 -0500	[thread overview]
Message-ID: <519DFB59.6090004@tabi.org> (raw)
In-Reply-To: <AE90C24D6B3A694183C094C60CF0A2F6026B7248@saturn3.aculab.com>

David Laight wrote:
>> strcpy(ssi_private->name, p) in probe() sets "name" by "p", gotten from dts,
>> >while the length of "p", if the devicetree node name of SSI is commonly set,
>> >would always be larger than 1 char size, so need a larger size for "name".
> Are you sure this isn't allowed for when the structure is allocated?
> Otherwise you also need to use strlcpy() as well.

Yes, this is already handled properly:

p = strrchr(np->full_name, '/') + 1;
ssi_private = kzalloc(sizeof(struct fsl_ssi_private) + strlen(p),
                       GFP_KERNEL);

Nicolin's patch is wrong.  Do not apply it.

-- 
Timur Tabi

  reply	other threads:[~2013-05-23 11:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-23  8:51 [PATCH] ASoC: fsl: expand the size of the name in fsl_ssi_private struct Nicolin Chen
2013-05-23 10:21 ` David Laight
2013-05-23 11:19   ` Timur Tabi [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-23  6:26 Nicolin Chen

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=519DFB59.6090004@tabi.org \
    --to=timur@tabi.org \
    --cc=David.Laight@ACULAB.COM \
    --cc=alsa-devel@alsa-project.org \
    --cc=b42378@freescale.com \
    --cc=broonie@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.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 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).