All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] spi: potential memleak in spidev_ioctl
@ 2007-05-16 23:33 Florin Malita
  0 siblings, 0 replies; only message in thread
From: Florin Malita @ 2007-05-16 23:33 UTC (permalink / raw)
  To: dbrownell, a.paterniani; +Cc: linux-kernel

'ioc' should be deallocated if __copy_from_user fails (found by Coverity 
- CID 1644).

Signed-off-by: Florin Malita <fmalita@gmail.com>
---

 spidev.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/spidev.c b/drivers/spi/spidev.c
index c0a6dce..2464f34 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;
 		}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-16 23:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-16 23:33 [PATCH] spi: potential memleak in spidev_ioctl Florin Malita

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.