]> git.karo-electronics.de Git - karo-tx-linux.git/commit
SCSI: libsrp: fix memory leak in srp_ring_free()
authorBart Van Assche <bart.vanassche@gmail.com>
Sun, 30 Aug 2009 10:36:48 +0000 (12:36 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 24 Sep 2009 15:43:50 +0000 (08:43 -0700)
commit328b1e3dfd68bdfa0cf3b592f775fd33f130733c
tree7e0d3a4eaec33a2c337ec98bfb4338c29bab565b
parent0ce24e272f2a107054065a679db02bd9d5feeebb
SCSI: libsrp: fix memory leak in srp_ring_free()

commit afffd3dabe5209882c8cc59a373a4d33b5db304a upstream.

This patch fixes a memory leak in the libsrp function srp_ring_free().
It is not documented whether or not this function should free the ring
pointer itself. But the source code of the callers of this function
(srp_target_alloc() and srp_target_free()) makes it clear that
srp_ring_free() should deallocate the ring pointer itself. Furthermore,
the patch below makes srp_ring_free() deallocate all memory allocated by
srp_ring_alloc().

This patch affects the ibmvstgt driver, which is the only in-tree driver
that calls the srp_ring_free() function (indirectly).

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/scsi/libsrp.c