From: Florin Malita Date: Wed, 23 May 2007 20:57:45 +0000 (-0700) Subject: spi: potential memleak in spidev_ioctl X-Git-Tag: v2.6.22-rc3~62 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9bea3f29fc626e190f012c4ad5f8a9e9a2f26cf6;p=linux-2.6 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 --- diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c index bcfef04f54..d04242aee4 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; }