diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2016-11-16 14:19:34 +0100 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2016-11-16 14:19:34 +0100 |
commit | 7ce7f35b33eb42b6aa4cf176fa34372b21b8472b (patch) | |
tree | 12f3027003f1d7cce30f838265e4fab2d52c6cef /drivers/misc/genwqe/card_utils.c | |
parent | f410770293a1fbc08906474c24104a7a11943eb6 (diff) | |
parent | 47bdf3378d62a627cfb8a54e1180c08d67078b61 (diff) | |
download | linux-stable-7ce7f35b33eb42b6aa4cf176fa34372b21b8472b.tar.gz linux-stable-7ce7f35b33eb42b6aa4cf176fa34372b21b8472b.tar.bz2 linux-stable-7ce7f35b33eb42b6aa4cf176fa34372b21b8472b.zip |
Merge branch 'x86/cpufeature' into x86/cache
Resolve the cpu/scattered conflict.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'drivers/misc/genwqe/card_utils.c')
-rw-r--r-- | drivers/misc/genwqe/card_utils.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/misc/genwqe/card_utils.c b/drivers/misc/genwqe/card_utils.c index 8a679ecc8fd1..fc2794b513fa 100644 --- a/drivers/misc/genwqe/card_utils.c +++ b/drivers/misc/genwqe/card_utils.c @@ -352,17 +352,27 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl, if (copy_from_user(sgl->lpage, user_addr + user_size - sgl->lpage_size, sgl->lpage_size)) { rc = -EFAULT; - goto err_out1; + goto err_out2; } } return 0; + err_out2: + __genwqe_free_consistent(cd, PAGE_SIZE, sgl->lpage, + sgl->lpage_dma_addr); + sgl->lpage = NULL; + sgl->lpage_dma_addr = 0; err_out1: __genwqe_free_consistent(cd, PAGE_SIZE, sgl->fpage, sgl->fpage_dma_addr); + sgl->fpage = NULL; + sgl->fpage_dma_addr = 0; err_out: __genwqe_free_consistent(cd, sgl->sgl_size, sgl->sgl, sgl->sgl_dma_addr); + sgl->sgl = NULL; + sgl->sgl_dma_addr = 0; + sgl->sgl_size = 0; return -ENOMEM; } |