lkml.org 
[lkml]   [1997]   [Aug]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: New pre-2.0.31 patches..

A patch for a memory leak in kernel/fork.c is missed. Together
with a change in kernel/sched.c. Seems to be important.


Werner

--------------------------------------------------------------------------------
diff -urN linux-2.0.31-linus/kernel/fork.c linux/kernel/fork.c
--- linux-2.0.31-linus/kernel/fork.c Fri Apr 4 06:02:28 1997
+++ linux/kernel/fork.c Tue Aug 5 17:45:33 1997
@@ -127,9 +127,11 @@
tsk->cmin_flt = tsk->cmaj_flt = 0;
tsk->nswap = tsk->cnswap = 0;
if (new_page_tables(tsk))
- return -1;
+ goto free_mm;
if (dup_mmap(mm)) {
free_page_tables(mm);
+free_mm:
+ kfree(mm);
return -1;
}
return 0;
diff -urN linux-2.0.31-linus/kernel/sched.c linux/kernel/sched.c
--- linux-2.0.31-linus/kernel/sched.c Tue Aug 5 11:59:25 1997
+++ linux/kernel/sched.c Tue Aug 5 17:45:33 1997
@@ -1459,9 +1459,11 @@
asmlinkage int sys_sched_yield(void)
{
cli();
- move_last_runqueue(current);
- current->counter = 0;
- need_resched = 1;
+ if (current->next_run) {
+ move_last_runqueue(current);
+ current->counter = 0;
+ need_resched = 1;
+ }
sti();
return 0;
}
@@ -1500,10 +1502,10 @@
error = verify_area(VERIFY_WRITE, interval, sizeof(struct timespec));
if (error)
return error;
-
+
+ /* Values taken from 2.1.38 */
t.tv_sec = 0;
- t.tv_nsec = 0; /* <-- Linus, please fill correct value in here */
- return -ENOSYS; /* and then delete this line. Thanks! */
+ t.tv_nsec = 150000; /* is this right for non-intel architecture too?*/
memcpy_tofs(interval, &t, sizeof(struct timespec));

return 0;
\
 
 \ /
  Last update: 2005-03-22 13:40    [from the cache]
©2003-2011 Jasper Spaans. Advertise on this site