diff options
author | Julia Lawall <julia@diku.dk> | 2010-05-22 10:22:49 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-22 11:49:37 +0100 |
commit | df1f1d1cb43b4ffdef5ba5f0623e2f73e94ce030 (patch) | |
tree | fdef68b0b5230b9f49f7b26eee33aee4e4f042e3 /crypto/gf128mul.c | |
parent | 39c5837d7968ffd68e1d3c79efba1631b7f513d9 (diff) |
drivers/mtd: Use memdup_user
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>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'crypto/gf128mul.c')
0 files changed, 0 insertions, 0 deletions