lkml.org 
[lkml]   [2007]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sns: add syscall to check signed state of a process [4/4]
On 070621 18:34, Akinobu Mita <akinobu.mita@gmail.com> wrote:
> 2007/6/22, Alexander Wuerstlein <arw@arw.name>:
>
>> +asmlinkage int sys_sns_is_trusted(pid_t p)
>> +{
>> + struct task_struct *t;
>> + rcu_read_lock();
>> + t = find_task_by_pid(p);
>> + if (IS_ERR(t)) {
>
> Shouldn't it be:
> if (!t) {
> ...
> ?
>
> find_task_by_pid() returns NULL on failure.

You seem to be right, the rest of the kernel just does 'if (!t)'. We just used
IS_ERR() as the 'check for evil pointers' function.




Ciao,

Alexander Wuerstlein.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-06-21 18:51    [W:0.157 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site