lkml.org 
[lkml]   [1998]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectsmall bug in 2.1.103 fs/proc/array.c
Hello,

Yesterday I was browsing 2.1.102 source and found what I believe to be a
bug (unless there is something clever gcc-optimization-related stuff is
going on that I don't understand). However, I did not report it because I
assumed it to be so obvious that 2.1.103 will probably fix it. But it did
not, so here is the source:

static int get_statm(int pid, char * buffer)
{
struct task_struct *tsk = find_task_by_pid(pid);
~~~~~~~~~~~~~~~~~~~~~~~~
int size=0, resident=0, share=0, trs=0, lrs=0, drs=0, dt=0;

read_lock(&tasklist_lock);
tsk = find_task_by_pid(pid);

Since the correct way to call find_task_by_pid() is probably after
read_lock(&tasklist_lock) the first initialisation of tsk is unnecessary.

Am I missing something?

Thanks,
Tigran.

-----------------------------------------------------
Tigran A. Aivazian | http://www.sco.com/
Escalations Research Group | Email: tigran@sco.com
Santa Cruz Operation Ltd | Ext: 6796
United Kingdom |


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

\
 
 \ /
  Last update: 2005-03-22 13:42    [W:0.036 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site