Files
linux-stable-mirror/include/linux
Li Zefan 610a77e04a memdup_user(): introduce
I notice there are many places doing copy_from_user() which follows
kmalloc():

        dst = kmalloc(len, GFP_KERNEL);
        if (!dst)
                return -ENOMEM;
        if (copy_from_user(dst, src, len)) {
		kfree(dst);
		return -EFAULT
	}

memdup_user() is a wrapper of the above code.  With this new function, we
don't have to write 'len' twice, which can lead to typos/mistakes.  It
also produces smaller code and kernel text.

A quick grep shows 250+ places where memdup_user() *may* be used.  I'll
prepare a patchset to do this conversion.

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Americo Wang <xiyou.wangcong@gmail.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-04-01 08:59:13 -07:00
..
2009-03-18 19:45:11 -07:00
2009-03-27 14:43:57 -04:00
2009-03-27 14:43:59 -04:00
2009-03-24 12:35:17 +01:00
2009-03-28 23:55:59 -07:00
2009-03-24 22:52:39 -04:00
2009-04-01 08:59:12 -07:00
2009-03-26 10:56:35 -07:00
2009-03-27 14:43:59 -04:00
2009-03-27 14:43:59 -04:00
2009-04-01 08:59:13 -07:00
2009-03-26 02:18:35 +01:00
2009-03-30 14:28:58 -07:00
2009-04-01 08:59:13 -07:00
2009-03-26 18:14:21 +01:00