mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
misc: genwqe: Fix potential memory leak when pinning memory
Fix a memory leak in the genwqe_pin_mem() error path as called by ioctl GENWQE_PIN_MEM. In case there is an error encountered when mapping memory, the already allocated dma_mapping struct needs to be freed correctly. Detected by Coverity: CID 1162606. Signed-off-by: Christian Engelmayer <[email protected]> Acked-by: Frank Haverkamp <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
d0f2a808b2
commit
d913c7439a
1 changed files with 1 additions and 0 deletions
|
|
@ -787,6 +787,7 @@ static int genwqe_pin_mem(struct genwqe_file *cfile, struct genwqe_mem *m)
|
|||
if (rc != 0) {
|
||||
dev_err(&pci_dev->dev,
|
||||
"[%s] genwqe_user_vmap rc=%d\n", __func__, rc);
|
||||
kfree(dma_map);
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue