summaryrefslogtreecommitdiff
path: root/drivers/misc/genwqe
diff options
context:
space:
mode:
authorChristian Engelmayer <cengelma@gmx.at>2014-01-26 01:47:44 +0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-08 03:24:31 +0400
commitd913c7439add288b50752186b306634df2ae21e7 (patch)
tree12d8572d310a8618f0333190a3fc8fb3f1a13ba8 /drivers/misc/genwqe
parentd0f2a808b2f0fa6e115cc6f6c84bb4f29aa8af49 (diff)
downloadlinux-d913c7439add288b50752186b306634df2ae21e7.tar.xz
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 <cengelma@gmx.at> Acked-by: Frank Haverkamp <haver@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/genwqe')
-rw-r--r--drivers/misc/genwqe/card_dev.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/genwqe/card_dev.c b/drivers/misc/genwqe/card_dev.c
index 8f8a6b327cdb..2c2c9cc75231 100644
--- a/drivers/misc/genwqe/card_dev.c
+++ b/drivers/misc/genwqe/card_dev.c
@@ -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;
}