mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[SCSI] target: Fix memory leak on error path in pscsi_alloc_task
If allocation of pt->pscsi_cdb fails, we need to free the just-allocated pt or else it will be leaked. Signed-off-by: Roland Dreier <[email protected]> Signed-off-by: Nicholas A. Bellinger <[email protected]> Signed-off-by: James Bottomley <[email protected]>
This commit is contained in:
parent
4b32030524
commit
8fc1858a42
1 changed files with 1 additions and 0 deletions
|
|
@ -816,6 +816,7 @@ pscsi_alloc_task(struct se_cmd *cmd)
|
|||
if (!(pt->pscsi_cdb)) {
|
||||
printk(KERN_ERR "pSCSI: Unable to allocate extended"
|
||||
" pt->pscsi_cdb\n");
|
||||
kfree(pt);
|
||||
return NULL;
|
||||
}
|
||||
} else
|
||||
|
|
|
|||
Loading…
Reference in a new issue