linux/drivers/scsi/aacraid
Jesper Juhl 7dd72f5189 drivers/scsi/aacraid/commctrl.c: fix mem leak in aac_send_raw_srb()
We leak in drivers/scsi/aacraid/commctrl.c::aac_send_raw_srb() :

We allocate memory:

	...
	struct user_sgmap* usg;
	usg = kmalloc(actual_fibsize - sizeof(struct aac_srb)
	  + sizeof(struct sgmap), GFP_KERNEL);

and then neglect to free it:

	...
	for (i = 0; i < usg->count; i++) {
		u64 addr;
		void* p;
		if (usg->sg[i].count >
		    ((dev->adapter_info.options &
		     AAC_OPT_NEW_COMM) ?
		      (dev->scsi_host_ptr->max_sectors << 9) :
		      65536)) {
			rcode = -EINVAL;
			goto cleanup;
	... this 'goto' makes 'usg' go out of scope and leak the memory we
	    allocated.

Other exits properly kfree(usg), it's just here it is neglected.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-01-08 14:15:21 -08:00
..
aachba.c scsi: Fix up files implicitly depending on module.h inclusion 2011-10-31 19:31:24 -04:00
aacraid.h Fix common misspellings 2011-03-31 11:26:23 -03:00
commctrl.c drivers/scsi/aacraid/commctrl.c: fix mem leak in aac_send_raw_srb() 2012-01-08 14:15:21 -08:00
comminit.c
commsup.c [SCSI] aacraid: reset should disable MSI interrupt 2011-09-22 11:17:32 +04:00
dpcsup.c
linit.c [SCSI] aacraid: controller hangs if kernel uses non-default ASPM policy 2011-11-11 08:19:01 -06:00
Makefile
nark.c
rkt.c
rx.c
sa.c
src.c Remove unneeded version.h includes from drivers/scsi/ 2011-09-15 14:57:07 +02:00
TODO