mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Merge of r914:
Fix possible crash in scst_copy_sg() git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/1.0.1.x@915 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2352,6 +2352,14 @@ void scst_copy_sg(struct scst_cmd *cmd, enum scst_sg_copy_dir copy_dir)
|
||||
"to_copy %d", cmd, copy_dir, src_sg, src_sg_cnt, dst_sg,
|
||||
to_copy);
|
||||
|
||||
if (unlikely(src_sg == NULL) || unlikely(dst_sg == NULL)) {
|
||||
/*
|
||||
* It can happened, e.g., with scst_user for cmd with delay
|
||||
* alloc, which failed with Check Condition.
|
||||
*/
|
||||
goto out;
|
||||
}
|
||||
|
||||
dst = sg_page(dst_sg);
|
||||
dst_len = dst_sg->length;
|
||||
dst_offs = dst_sg->offset;
|
||||
|
||||
Reference in New Issue
Block a user