mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 21:26:31 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user