From: Dan Carpenter Date: Mon, 20 Mar 2017 14:40:32 +0000 (+0000) Subject: Staging: atomisp: fix locking in alloc_user_pages() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=af4fd0e7a43633e768685b8baf0b5d11d952bbe6;p=openwrt%2Fstaging%2Fblogic.git Staging: atomisp: fix locking in alloc_user_pages() We call this function with the lock held and should also return with the lock held as well. This one error path is not-consistent because we should return without the lock held. Signed-off-by: Dan Carpenter Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c index e2aa94991aee..82593ef35b2d 100644 --- a/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c +++ b/drivers/staging/media/atomisp/pci/atomisp2/hmm/hmm_bo.c @@ -1011,6 +1011,7 @@ static int alloc_user_pages(struct hmm_buffer_object *bo, dev_err(atomisp_dev, "find_vma failed\n"); atomisp_kernel_free(bo->page_obj); atomisp_kernel_free(pages); + mutex_lock(&bo->mutex); return -EFAULT; } mutex_lock(&bo->mutex);