From 9bea3f29fc626e190f012c4ad5f8a9e9a2f26cf6 Mon Sep 17 00:00:00 2001 From: Florin Malita Date: Wed, 23 May 2007 13:57:45 -0700 Subject: [PATCH] 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 Signed-off-by: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/spi/spidev.c | 1 + 1 file changed, 1 insertion(+) 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; }