Merge "msm: ais: jpegdma: Fix for ASAN issues in jpegdma module"

This commit is contained in:
Linux Build Service Account 2018-04-13 04:52:17 -07:00 committed by Gerrit - the friendly Code Review server
commit 7c5a58c945

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved. /* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and * it under the terms of the GNU General Public License version 2 and
@ -754,9 +754,12 @@ static int msm_jpegdma_s_fmt_vid_out(struct file *file,
static int msm_jpegdma_reqbufs(struct file *file, static int msm_jpegdma_reqbufs(struct file *file,
void *fh, struct v4l2_requestbuffers *req) void *fh, struct v4l2_requestbuffers *req)
{ {
int ret = 0;
struct jpegdma_ctx *ctx = msm_jpegdma_ctx_from_fh(fh); struct jpegdma_ctx *ctx = msm_jpegdma_ctx_from_fh(fh);
mutex_lock(&ctx->lock);
return v4l2_m2m_reqbufs(file, ctx->m2m_ctx, req); ret = v4l2_m2m_reqbufs(file, ctx->m2m_ctx, req);
mutex_unlock(&ctx->lock);
return ret;
} }
/* /*
@ -833,11 +836,11 @@ static int msm_jpegdma_streamoff(struct file *file,
{ {
struct jpegdma_ctx *ctx = msm_jpegdma_ctx_from_fh(fh); struct jpegdma_ctx *ctx = msm_jpegdma_ctx_from_fh(fh);
int ret; int ret;
mutex_lock(&ctx->lock);
ret = v4l2_m2m_streamoff(file, ctx->m2m_ctx, buf_type); ret = v4l2_m2m_streamoff(file, ctx->m2m_ctx, buf_type);
if (ret < 0) if (ret < 0)
dev_err(ctx->jdma_device->dev, "Stream off fails\n"); dev_err(ctx->jdma_device->dev, "Stream off fails\n");
mutex_unlock(&ctx->lock);
return ret; return ret;
} }