mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 05:06:31 +00:00
Fixes possible *dev_cmd_count leak
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@303 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2312,9 +2312,6 @@ static int scst_pre_dev_done(struct scst_cmd *cmd)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
atomic_dec(&cmd->tgt_dev->tgt_dev_cmd_count);
|
||||
atomic_dec(&cmd->dev->dev_cmd_count);
|
||||
|
||||
rc = scst_done_cmd_check(cmd, &res);
|
||||
if (rc)
|
||||
goto out;
|
||||
@@ -2505,7 +2502,10 @@ static int scst_pre_xmit_response(struct scst_cmd *cmd)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (cmd->tgt_dev != NULL) {
|
||||
if (likely(cmd->tgt_dev != NULL)) {
|
||||
atomic_dec(&cmd->tgt_dev->tgt_dev_cmd_count);
|
||||
atomic_dec(&cmd->dev->dev_cmd_count);
|
||||
|
||||
if (unlikely(cmd->queue_type == SCST_CMD_QUEUE_HEAD_OF_QUEUE))
|
||||
scst_on_hq_cmd_response(cmd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user