From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai 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 Message-ID: References: <1459327952-5313-1-git-send-email-han.lu@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 01148266267 for ; Wed, 30 Mar 2016 11:19:46 +0200 (CEST) In-Reply-To: <1459327952-5313-1-git-send-email-han.lu@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org 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 List-Id: alsa-devel@alsa-project.org 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