From: Takashi Iwai <tiwai@suse.de>
To: han.lu@intel.com
Cc: vinod.koul@intel.com, liam.r.girdwood@linux.intel.com,
alsa-devel@alsa-project.org, broonie@kernel.org,
pierre-louis.bossart@linux.intel.com
Subject: Re: [PATCH V2 1/1] ASoC: add a core API to share more product information with user space
Date: Wed, 30 Mar 2016 11:19:45 +0200 [thread overview]
Message-ID: <s5hvb441fwu.wl-tiwai@suse.de> (raw)
In-Reply-To: <1459327952-5313-1-git-send-email-han.lu@intel.com>
On Wed, 30 Mar 2016 10:52:32 +0200,
han.lu@intel.com wrote:
>
> + /* card long name / card component */
> + name = kstrdup(card->name, GFP_KERNEL);
> + if (!name)
> + return -ENOMEM;
> + strcat(name, ":");
> + strcat(name, card->driver_name);
> + strcat(name, ":");
> + if (vendor)
> + strcat(name, vendor);
> + strcat(name, ":");
> + if (firmware)
> + strcat(name, firmware);
strcat() can't be used in that way. You'd need to allocate an enough
large string buffer, and use strlcat() to fill in.
Also, ideally check whether each name string has no colon letter
included. Otherwise it'll confuse the parser in user space.
thanks,
Takashi
prev parent reply other threads:[~2016-03-30 9:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 8:52 [PATCH V2 1/1] ASoC: add a core API to share more product information with user space han.lu
2016-03-30 9:04 ` Liam Girdwood
2016-03-30 9:19 ` Takashi Iwai [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=s5hvb441fwu.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=han.lu@intel.com \
--cc=liam.r.girdwood@linux.intel.com \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=vinod.koul@intel.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.