mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Fix for memory overwrite-after-free bug in scst_local
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@575 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1436,7 +1436,12 @@ void scst_free_cmd(struct scst_cmd *cmd)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
scst_check_restore_sg_buff(cmd);
|
||||
/*
|
||||
* Target driver can already free sg buffer before calling
|
||||
* scst_tgt_cmd_done(). E.g., scst_local has to do that.
|
||||
*/
|
||||
if (!cmd->tgt_data_buf_alloced)
|
||||
scst_check_restore_sg_buff(cmd);
|
||||
|
||||
if (unlikely(cmd->internal)) {
|
||||
if (cmd->bufflen > 0)
|
||||
|
||||
Reference in New Issue
Block a user