From patchwork Wed Mar 6 21:13:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dafna Hirschfeld X-Patchwork-Id: 10841745 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C5AC0922 for ; Wed, 6 Mar 2019 21:14:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B2BEF2DFBA for ; Wed, 6 Mar 2019 21:14:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A726B2E074; Wed, 6 Mar 2019 21:14:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5CEEB2DFBA for ; Wed, 6 Mar 2019 21:14:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726654AbfCFVOM (ORCPT ); Wed, 6 Mar 2019 16:14:12 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:38623 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726648AbfCFVOL (ORCPT ); Wed, 6 Mar 2019 16:14:11 -0500 Received: by mail-wm1-f67.google.com with SMTP id a188so7219000wmf.3 for ; Wed, 06 Mar 2019 13:14:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dvajL4wp99YEdlSFfMaxVmGJLQp55KLRy+dOmN6R5Zk=; b=khLq6w5s4n+HFM5DlbDHVj+niETS4gGqthKaqGwqmzLxD4s+R7HxoGp8bpVgtadhHz f2RR/QGithVxni6IhuYoGFfAi3R/TDQDK3wXqIIhT14WAxzt7BuYbtd3ay06CqtNwe2u DtDBAG7F4GMl2VhXKmYUA02ZHFV/aYnZ2Zf9pixYKe2+y98UTK0mj6Vsx/rK3CSJsSTd ApkTmg/VT8qK9arf3/Niwq1VZmIzuaS4LjWJ56zJwWhg5bMS4LJcakbwjc6Dec1exudC 0XcyWxd7vyZdR9pT3Ht15RzW21bJxJmlMOgHTGqe3a0PdJD0f8J4yWe2hQSgcS91ksmI aG9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=dvajL4wp99YEdlSFfMaxVmGJLQp55KLRy+dOmN6R5Zk=; b=uHnnSXzrv2D9cgbsx64c3lfhPzXyBP77LjjtnJjdsomRA8q31NJmkVpnx6VZf+w3nR bmkyP0XxZnPPkMWmHQHBJmaHjFe/cnwBoBFj2kWafg3MZK+uBc74Tc0IlFnufelFWZxt nTK4AAA4rhZRuO+NcHTxCRNgykunLJo+g91rJqwLfncZkO6aPQ2mrgqu/bVYmFauRhrl K20NIV7lWbHuY4IffEhEhe9uLi+9sfpquJ1XN1mhX92b+3djjXa96t4i7nm7TSEnRa8Y rYCp81Q6XHt4zxECXRmtFXa+QLBXVaIqqtGrtgB/XF62bvqzThjd35u5Oa0EtXiNV6vS pPPQ== X-Gm-Message-State: APjAAAWPWjTq7m4TxTWtbT9zH+OmlNx5Ikm16oCsSHtkgj8FO4HcSWyh XKgUqnDYMn9ZanIL5LKipcvlREgAUXU= X-Google-Smtp-Source: APXvYqyq8WM4llzWezN3pXfzKJizGq/VG9VwOVQzJXNTvoTjg4pIkMoX+MKcXGmUsMIg6KycdUlLVQ== X-Received: by 2002:a1c:2743:: with SMTP id n64mr3847569wmn.143.1551906849545; Wed, 06 Mar 2019 13:14:09 -0800 (PST) Received: from ubuntu.home ([77.124.117.239]) by smtp.gmail.com with ESMTPSA id a9sm1882126wmm.10.2019.03.06.13.14.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Mar 2019 13:14:09 -0800 (PST) From: Dafna Hirschfeld To: linux-media@vger.kernel.org Cc: hverkuil@xs4all.nl, helen.koike@collabora.com, Dafna Hirschfeld Subject: [PATCH v5 05/23] media: vicodec: upon release, call m2m release before freeing ctrl handler Date: Wed, 6 Mar 2019 13:13:25 -0800 Message-Id: <20190306211343.15302-6-dafna3@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190306211343.15302-1-dafna3@gmail.com> References: <20190306211343.15302-1-dafna3@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 'v4l2_m2m_ctx_release' calls request complete so it should be called before 'v4l2_ctrl_handler_free'. Signed-off-by: Dafna Hirschfeld --- drivers/media/platform/vicodec/vicodec-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/vicodec/vicodec-core.c b/drivers/media/platform/vicodec/vicodec-core.c index b92a91e06e18..0909f86547f1 100644 --- a/drivers/media/platform/vicodec/vicodec-core.c +++ b/drivers/media/platform/vicodec/vicodec-core.c @@ -1606,12 +1606,12 @@ static int vicodec_release(struct file *file) struct video_device *vfd = video_devdata(file); struct vicodec_ctx *ctx = file2ctx(file); - v4l2_fh_del(&ctx->fh); - v4l2_fh_exit(&ctx->fh); - v4l2_ctrl_handler_free(&ctx->hdl); mutex_lock(vfd->lock); v4l2_m2m_ctx_release(ctx->fh.m2m_ctx); mutex_unlock(vfd->lock); + v4l2_fh_del(&ctx->fh); + v4l2_fh_exit(&ctx->fh); + v4l2_ctrl_handler_free(&ctx->hdl); kfree(ctx); return 0;