From: Nicholas Bellinger Date: Sun, 18 Mar 2012 03:12:36 +0000 (-0700) Subject: ib_srpt: Fix srpt_handle_cmd send_ioctx->ioctx_kref leak on exception X-Git-Tag: v3.4-rc1~146^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=187e70a554e0f0717a65998bc9199945cbbd4692;p=pandora-kernel.git ib_srpt: Fix srpt_handle_cmd send_ioctx->ioctx_kref leak on exception This patch addresses a bug in srpt_handle_cmd() failure handling where send_ioctx->kref is being leaked with the local extra reference after init, causing the expected kref_put() in srpt_handle_send_comp() to not be the final call to invoke srpt_put_send_ioctx_kref() -> transport_generic_free_cmd() and perform se_cmd descriptor memory release. It also fixes a SCF_SCSI_RESERVATION_CONFLICT handling bug where this code is incorrectly falling through to transport_handle_cdb_direct() after invoking srpt_queue_status() to send SAM_STAT_RESERVATION_CONFLICT status. Note this patch is for >= v3.3 mainline code, and current lio-core.git code has already been converted to target_submit_cmd() + se_cmd->cmd_kref usage, and internal ioctx->kref usage has been removed. I'm including this patch now into target-pending/for-next with a CC' for v3.3 stable. Cc: Bart Van Assche Cc: Roland Dreier Cc: stable@vger.kernel.org Signed-off-by: Nicholas Bellinger --- Reading git-diff-tree failed