summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJesper Juhl <jj@chaosbits.net>2010-10-29 16:10:26 +0200
committerJohn W. Linville <linville@tuxdriver.com>2010-10-29 14:33:26 -0400
commit520efd1ace3f826120482e57a95d649b4e1c1684 (patch)
tree04445d2fde489b7b7a3d8fa4898a0731817f6ca0 /drivers
parent731b2034999bbfe86c9074f1b0d611940bf7c323 (diff)
downloadlinux-3.10-520efd1ace3f826120482e57a95d649b4e1c1684.tar.gz
linux-3.10-520efd1ace3f826120482e57a95d649b4e1c1684.tar.bz2
linux-3.10-520efd1ace3f826120482e57a95d649b4e1c1684.zip
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>
Diffstat (limited to 'drivers')
0 files changed, 0 insertions, 0 deletions