kernel_optimize_test/fs/autofs4
Julia Lawall 7ca5ca60cb fs/autofs4: use memdup_user
Use memdup_user when user data is immediately copied into the allocated
region.  Elimination of the variable ads, which is no longer useful.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
position p;
identifier l1,l2;
@@

-  to = \(kmalloc@p\|kzalloc@p\)(size,flag);
+  to = memdup_user(from,size);
   if (
-      to==NULL
+      IS_ERR(to)
                 || ...) {
   <+... when != goto l1;
-  -ENOMEM
+  PTR_ERR(to)
   ...+>
   }
-  if (copy_from_user(to, from, size) != 0) {
-    <+... when != goto l2;
-    -EFAULT
-    ...+>
-  }
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Cc: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:41 -07:00
..
autofs_i.h Revert "autofs4: always use lookup for lookup" 2010-03-03 12:58:31 -05:00
dev-ioctl.c fs/autofs4: use memdup_user 2010-05-27 09:12:41 -07:00
expire.c Revert "autofs4: always use lookup for lookup" 2010-03-03 12:58:31 -05:00
init.c
inode.c Use kill_litter_super() in autofs4 ->kill_sb() 2010-03-03 14:07:54 -05:00
Kconfig
Makefile
root.c autofs4: Pushdown the bkl from ioctl 2010-05-22 17:44:18 +02:00
symlink.c
waitq.c