2003-03-13 18:44:16

by Oleg Drokin

[permalink] [raw]
Subject: [2.5] memleak in drivers/scsi/cpqfcTSinit.c::cpqfcTS_ioctl

Hello!

There seem to be a memleak on error exit path if copy_to_user() fails.
See the patch below.

Bye,
Oleg

===== drivers/scsi/cpqfcTSinit.c 1.32 vs edited =====
--- 1.32/drivers/scsi/cpqfcTSinit.c Tue Feb 25 21:47:18 2003
+++ edited/drivers/scsi/cpqfcTSinit.c Thu Mar 13 21:50:33 2003
@@ -686,7 +686,7 @@
if( (vendor_cmd->rw_flag == VENDOR_READ_OPCODE) &&
vendor_cmd->len )
if( copy_to_user( vendor_cmd->bufp, buf, vendor_cmd->len))
- return( -EFAULT);
+ result = -EFAULT;

if( buf)
kfree( buf);