Fixes possible crash on BUG_ON (or memory leak without it), if REQUEST SENSE was issued on a command, in which empty sense was returned.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@686 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2009-03-03 18:17:36 +00:00
parent bc7c69bfc4
commit 485c9c7f29
+7
View File
@@ -1069,6 +1069,13 @@ int scst_prepare_request_sense(struct scst_cmd *orig_cmd)
TRACE_ENTRY();
if (orig_cmd->sense != NULL) {
TRACE_MEM("Releasing sense %p (orig_cmd %p)",
orig_cmd->sense, orig_cmd);
mempool_free(orig_cmd->sense, scst_sense_mempool);
orig_cmd->sense = NULL;
}
rs_cmd = scst_create_prepare_internal_cmd(orig_cmd, sbuf_size);
if (rs_cmd == NULL)
goto out_error;