aboutsummaryrefslogtreecommitdiffstats
path: root/fs/hostfs
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-10-29 15:14:18 -0400
committerChris Mason <chris.mason@oracle.com>2010-10-29 15:14:18 -0400
commit2354d08fe9aeec3e451b85cb5387a6b28dbca0b1 (patch)
tree7a3f43dfac81fc54faf231400a4b871ca24bb031 /fs/hostfs
parent18e503d695ff8ff9a43768555aa74575bf6b77f3 (diff)
downloadkernel_samsung_aries-2354d08fe9aeec3e451b85cb5387a6b28dbca0b1.zip
kernel_samsung_aries-2354d08fe9aeec3e451b85cb5387a6b28dbca0b1.tar.gz
kernel_samsung_aries-2354d08fe9aeec3e451b85cb5387a6b28dbca0b1.tar.bz2
Btrfs: use memdup_user helpers
Use memdup_user when user data is immediately copied into the allocated region. 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: Chris Mason <chris.mason@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/hostfs')
0 files changed, 0 insertions, 0 deletions