Skip to content

Commit

Permalink
Call kthread_create() correctly with fixed arguments.
Browse files Browse the repository at this point in the history
The kernel's kthread_create() function is defined as "..." and there is
no va_list variant at the moment.  The task name is pre-formatted into
a small buffer on the stack and kthread_create() is called with a single
fixed string argument.
  • Loading branch information
dweeezil committed Apr 11, 2014
1 parent ed650de commit e9cc52d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion module/spl/spl-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,13 @@ spl_kthread_create(int (*func)(void *), void *data, const char namefmt[], ...)
{
struct task_struct *tsk;
va_list args;
char name[100];

va_start(args, namefmt);
vsnprintf(name, sizeof(name), namefmt, args);
va_end(args);
do {
tsk = kthread_create(func, data, namefmt, args);
tsk = kthread_create(func, data, name);
if (IS_ERR(tsk)) {
if (signal_pending(current)) {
clear_thread_flag(TIF_SIGPENDING);
Expand Down

0 comments on commit e9cc52d

Please sign in to comment.