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

Next file: linux-2.4.21/fs/proc/base.c
Previous file: linux-2.4.21/fs/partitions/ldm.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/fs/proc/array.c linux-2.4.21/fs/proc/array.c
@@ -567,6 +567,8 @@
 		line = d_path(map->vm_file->f_dentry,
 			      map->vm_file->f_vfsmnt,
 			      buf, PAGE_SIZE);
+		if (IS_ERR(line))
+			return PTR_ERR(line);
 		buf[PAGE_SIZE-1] = '\n';
 		line -= MAPS_LINE_MAX;
 		if(line < buf)
@@ -640,6 +642,8 @@
 			goto next;
 		}
 		len = proc_pid_maps_get_line(tmp, map);
+		if (len < 0)
+			goto out_unlock;
 		len -= off;
 		if (len > 0) {
 			if (retval+len > count) {
@@ -661,6 +665,8 @@
 		if (loff) BUG();
 		map = map->vm_next;
 	}
+
+out_unlock:
 	up_read(&mm->mmap_sem);
 	mmput(mm);
 

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