patch-2.4.21 linux-2.4.21/fs/proc/base.c

Next file: linux-2.4.21/fs/proc/generic.c
Previous file: linux-2.4.21/fs/proc/array.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/fs/proc/base.c linux-2.4.21/fs/proc/base.c
@@ -360,12 +360,15 @@
 	if (mm)
 		atomic_inc(&mm->mm_users);
 	task_unlock(task);
-	if (!mm)
-		return 0;
+	if (!mm){
+		copied = 0;
+		goto out_free;
+	}
 
 	if (file->private_data != (void*)((long)current->self_exec_id) ) {
 		mmput(mm);
-		return -EIO;
+		copied = -EIO;
+		goto out_free;
 	}
 		
 
@@ -390,6 +393,8 @@
 	}
 	*ppos = src;
 	mmput(mm);
+
+out_free:
 	free_page((unsigned long) page);
 	return copied;
 }
@@ -480,6 +485,8 @@
 		
 	inode = dentry->d_inode;
 	path = d_path(dentry, mnt, tmp, PAGE_SIZE);
+	if (IS_ERR(path))
+		return PTR_ERR(path);
 	len = tmp + PAGE_SIZE - 1 - path;
 
 	if (len < buflen)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)