Julia Lawall
7d543d8468
drivers/ide: 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 S. Miller <davem@davemloft.net>
2010-08-09 03:17:53 -07:00
..
2010-01-19 01:45:29 -08:00
2010-01-19 01:44:41 -08:00
2010-01-19 01:52:31 -08:00
2010-01-19 01:52:32 -08:00
2010-01-19 01:44:41 -08:00
2010-01-19 01:45:29 -08:00
2010-03-04 08:24:06 -08:00
2009-06-15 18:52:58 +02:00
2010-01-19 01:52:32 -08:00
2010-05-11 00:08:03 -07:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:52:33 -08:00
2010-01-19 01:52:33 -08:00
2010-01-19 01:45:29 -08:00
2009-05-17 19:12:25 +02:00
2010-01-19 01:44:41 -08:00
2009-06-15 18:52:58 +02:00
2010-05-26 19:51:09 +02:00
2010-03-30 22:02:32 +09:00
2010-01-19 01:44:41 -08:00
2010-03-02 23:57:59 -08:00
2010-04-15 14:20:53 -07:00
2009-05-17 19:12:25 +02:00
2010-03-30 22:02:32 +09:00
2010-04-08 07:45:36 -07:00
2010-03-30 22:02:32 +09:00
2008-04-29 14:48:55 +02:00
2010-08-09 03:17:49 -07:00
2009-04-28 07:37:30 +02:00
2010-08-03 09:04:11 +02:00
2010-03-30 22:02:32 +09:00
2008-10-21 07:47:30 -04:00
2010-03-30 22:02:32 +09:00
2010-05-21 20:01:02 +02:00
2008-10-21 07:47:30 -04:00
2009-04-08 14:12:49 +02:00
2010-04-08 07:45:36 -07:00
2009-06-25 23:57:16 -07:00
2009-05-15 06:44:38 +02:00
2009-09-01 17:52:57 -07:00
2010-03-30 22:02:32 +09:00
2008-10-21 07:47:30 -04:00
2010-06-16 18:08:13 +02:00
2009-03-27 12:46:34 +01:00
2009-05-17 19:12:25 +02:00
2009-05-17 19:12:25 +02:00
2009-04-08 14:13:03 +02:00
2010-04-01 01:31:13 -07:00
2010-03-30 22:02:32 +09:00
2010-01-19 01:41:57 -08:00
2009-05-17 19:12:25 +02:00
2009-05-22 20:28:35 +02:00
2010-03-30 22:02:32 +09:00
2009-12-03 14:35:31 -05:00
2008-07-16 20:33:39 +02:00
2010-03-30 22:02:32 +09:00
2009-05-17 19:12:25 +02:00
2010-03-28 18:58:28 -07:00
2010-03-30 22:02:32 +09:00
2008-04-26 22:25:20 +02:00
2009-01-02 16:12:48 +01:00
2010-01-12 01:56:54 -08:00
2010-08-09 03:17:53 -07:00
2010-01-19 11:30:09 -08:00
2010-01-19 01:52:36 -08:00
2010-03-30 22:02:32 +09:00
2010-03-30 22:02:32 +09:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2009-10-29 03:09:26 -07:00
2009-06-15 18:52:58 +02:00
2009-03-31 20:15:24 +02:00
2009-04-08 14:13:03 +02:00
2010-01-19 01:44:41 -08:00
2010-01-19 01:52:34 -08:00
2010-01-19 01:45:29 -08:00
2010-04-22 19:11:24 -07:00
2010-01-19 01:45:29 -08:00
2010-06-02 17:50:38 +10:00
2009-06-15 18:52:58 +02:00
2010-01-19 01:44:41 -08:00
2009-06-15 22:13:44 +02:00
2010-03-30 22:02:32 +09:00
2008-12-29 20:27:33 +01:00
2010-03-30 22:02:32 +09:00
2010-03-02 23:57:59 -08:00
2010-01-19 01:45:29 -08:00
2009-06-10 14:37:21 +02:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:52:35 -08:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2010-01-19 01:45:29 -08:00
2009-03-31 20:15:32 +02:00
2010-01-19 01:52:35 -08:00
2010-01-19 01:52:35 -08:00
2010-01-19 01:44:41 -08:00
2010-08-09 03:17:51 -07:00