mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* sx memleak.
@ 2003-05-15  3:31 davej
  0 siblings, 0 replies; only message in thread
From: davej @ 2003-05-15  3:31 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel

diff -urpN --exclude-from=/home/davej/.exclude bk-linus/drivers/char/sx.c linux-2.5/drivers/char/sx.c
--- bk-linus/drivers/char/sx.c	2003-05-14 01:32:18.000000000 +0100
+++ linux-2.5/drivers/char/sx.c	2003-04-26 15:08:04.000000000 +0100
@@ -1739,8 +1739,10 @@ static int sx_fw_ioctl (struct inode *in
 				if (copy_from_user(tmp, (char *)data + i, 
 						   (i + SX_CHUNK_SIZE >
 						    nbytes) ? nbytes - i :
-						   	      SX_CHUNK_SIZE))
+						   	      SX_CHUNK_SIZE)) {
+					kfree (tmp);
 					return -EFAULT;
+				}
 				memcpy_toio    ((char *) (board->base2 + offset + i), tmp, 
 				                (i+SX_CHUNK_SIZE>nbytes)?nbytes-i:SX_CHUNK_SIZE);
 			}

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

only message in thread, other threads:[~2003-05-15  3:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-15  3:31 sx memleak davej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®