30 Mar
2016
30 Mar
'16
11:19 a.m.
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