]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
SCSI: libiscsi: fix iscsi pool error path
authorJean Delvare <jdelvare@suse.de>
Thu, 5 Mar 2009 20:45:55 +0000 (14:45 -0600)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:56:48 +0000 (10:56 -0700)
commit28007cf3d87ce574610a3f8a6b0ca4275eaac6dc
tree2bde00d14d355279fa64127cb3ca8f601ad7b185
parentd2f500f5d2bb54093f59fd32e223a333c32f5604
SCSI: libiscsi: fix iscsi pool error path

upstream commit: f474a37bc48667595b5653a983b635c95ed82a3b

Memory freeing in iscsi_pool_free() looks wrong to me. Either q->pool
can be NULL and this should be tested before dereferencing it, or it
can't be NULL and it shouldn't be tested at all. As far as I can see,
the only case where q->pool is NULL is on early error in
iscsi_pool_init(). One possible way to fix the bug is thus to not
call iscsi_pool_free() in this case (nothing needs to be freed anyway)
and then we can get rid of the q->pool check.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/libiscsi.c