Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA7D3C010CF for ; Tue, 5 Nov 2019 12:10:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A94A7222C2 for ; Tue, 5 Nov 2019 12:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572955817; bh=O5RKml2JmX9sEnxKa+qULY87dxqPQ5kejJDYPMfwtCI=; h=From:Date:Subject:To:Cc:Reply-to:List-ID:From; b=NcTIJRZ5FsDYS0+jB+8fGaW7tDoQmlHwI/tomW3qcBEu6qdK+FDQVKZUvU0+kzTTz S9SM50q+F7PijvY3aWiPZSXSGKcxHxawG4hiMhVDlgOdGGFrpcqvslkn7iKRhLfM8B pfuuyIKctwckRbqgzx+22+1QqWQ8Gdv6d2GPM3iI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387744AbfKEMKR (ORCPT ); Tue, 5 Nov 2019 07:10:17 -0500 Received: from www.linuxtv.org ([130.149.80.248]:42212 "EHLO www.linuxtv.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726524AbfKEMKR (ORCPT ); Tue, 5 Nov 2019 07:10:17 -0500 Received: from mchehab by www.linuxtv.org with local (Exim 4.84_2) (envelope-from ) id 1iRxf2-0002u2-LS; Tue, 05 Nov 2019 12:10:12 +0000 From: Mauro Carvalho Chehab Date: Tue, 05 Nov 2019 11:50:02 +0000 Subject: [git:media_tree/master] media: bdisp: fix memleak on release To: linuxtv-commits@linuxtv.org Cc: Johan Hovold , Fabien Dessenne , Hans Verkuil , stable Mail-followup-to: linux-media@vger.kernel.org Forward-to: linux-media@vger.kernel.org Reply-to: linux-media@vger.kernel.org Message-Id: Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org This is an automatic generated email to let you know that the following patch were queued: Subject: media: bdisp: fix memleak on release Author: Johan Hovold Date: Thu Oct 10 10:13:31 2019 -0300 If a process is interrupted while accessing the video device and the device lock is contended, release() could return early and fail to free related resources. Note that the return value of the v4l2 release file operation is ignored. Fixes: 28ffeebbb7bd ("[media] bdisp: 2D blitter driver using v4l2 mem2mem framework") Cc: stable # 4.2 Signed-off-by: Johan Hovold Reviewed-by: Fabien Dessenne Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- diff --git a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c index e90f1ba30574..675b5f2b4c2e 100644 --- a/drivers/media/platform/sti/bdisp/bdisp-v4l2.c +++ b/drivers/media/platform/sti/bdisp/bdisp-v4l2.c @@ -651,8 +651,7 @@ static int bdisp_release(struct file *file) dev_dbg(bdisp->dev, "%s\n", __func__); - if (mutex_lock_interruptible(&bdisp->lock)) - return -ERESTARTSYS; + mutex_lock(&bdisp->lock); v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);