Jesper Juhl 520efd1ace mac80211: fix failure to check kmalloc return value in key_key_read
I noticed two small issues in mac80211/debugfs_key.c::key_key_read while
reading through the code. Patch below.

The key_key_read() function returns ssize_t and the value that's actually
returned is the return value of simple_read_from_buffer() which also
returns ssize_t, so let's hold the return value in a ssize_t local
variable rather than a int one.

Also, memory is allocated dynamically with kmalloc() which can fail, but
the return value of kmalloc() is not checked, so we may end up operating
on a null pointer further on. So check for a NULL return and bail out with
-ENOMEM in that case.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2010-10-29 14:33:26 -04:00
..
2010-10-13 15:45:22 -04:00
2009-07-10 15:01:49 -04:00
2010-10-13 15:45:23 -04:00
2008-04-08 16:44:45 -04:00
2010-06-14 15:38:17 -04:00
2010-10-25 14:43:13 -04:00
2010-10-07 14:41:27 -04:00
2010-07-08 16:35:50 -04:00
2010-07-08 16:35:50 -04:00
2010-10-06 16:30:40 -04:00
2010-10-11 15:04:23 -04:00
2010-07-08 16:35:50 -04:00
2010-01-05 16:21:40 -05:00
2010-09-27 15:57:54 -04:00