lkml.org 
[lkml]   [2011]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
DateTue, 19 Apr 2011 18:25:27 -0700 (PDT)
FromDavid Rientjes <>
SubjectRe: [PATCH 3/4] Intel PTI implementaiton of MIPI 1149.7.
On Tue, 19 Apr 2011, james_p_freyensee@linux.intel.com wrote:

> +static void pti_control_frame_built_and_sent(struct pti_masterchannel *mc)
> +{
> + struct pti_masterchannel mccontrol = {.master = CONTROL_ID,
> + .channel = 0};
> + const char *control_format = "%3d %3d %s";
> +
> + char comm[sizeof(current->comm) + 1];
> + u8 control_frame[CONTROL_FRAME_LEN];
> +
> + if (!in_interrupt())
> + get_task_comm(comm, current);
> + else
> + strcpy(comm, "Interrupt");
> +
> + /* Ensure our buffer is zero terminated */
> + comm[sizeof(current->comm)] = 0;
> +

You definitely need to use get_task_comm() here, but that means you can't
allocate char comm[] on the stack with anything but TASK_COMM_LEN, which
is small enough that it shouldn't be an issue. Otherwise there's nothing
protecting sizeof(current->comm) from changing without holding
task_lock(current).


\
 
 \ /
  Last update: 2011-04-20 03:33    [from the cache]
©2003-2010