summaryrefslogtreecommitdiffstats
path: root/drivers/spi
diff options
context:
space:
mode:
authorFlorin Malita <fmalita@gmail.com>2007-05-23 22:57:45 +0200
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-24 05:14:12 +0200
commit9bea3f29fc626e190f012c4ad5f8a9e9a2f26cf6 (patch)
tree156a6c3cb913aef5bf8244e6333802950f8132b8 /drivers/spi
parentoptimize compat_core_sys_select() by a using stack space for small fd sets (diff)
downloadlinux-9bea3f29fc626e190f012c4ad5f8a9e9a2f26cf6.tar.xz
linux-9bea3f29fc626e190f012c4ad5f8a9e9a2f26cf6.zip
spi: potential memleak in spidev_ioctl
'ioc' should be deallocated if __copy_from_user fails (found by Coverity - CID 1644). Signed-off-by: Florin Malita <fmalita@gmail.com> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/spi')
-rw-r--r--drivers/spi/spidev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index bcfef04f547e..d04242aee40d 100644
--- a/drivers/spi/spidev.c
+++ b/drivers/spi/spidev.c
@@ -364,6 +364,7 @@ spidev_ioctl(struct inode *inode, struct file *filp,
break;
}
if (__copy_from_user(ioc, (void __user *)arg, tmp)) {
+ kfree(ioc);
retval = -EFAULT;
break;
}