From patchwork Tue Apr 6 17:34:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mirela Rabulea OSS X-Patchwork-Id: 12185617 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT 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 7FFE7C433B4 for ; Tue, 6 Apr 2021 17:36:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 174E5613C2 for ; Tue, 6 Apr 2021 17:36:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 174E5613C2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oss.nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=qFK+cEp6nETNAO7z3vNeeO9bi3w+l+ea7u9hrf7KMF0=; b=PZmTp6bR4ZeMpSjsuhjuv2yFD1 wEL9FBcjVJnJ6KbnOysBWQkfXvhzrcSzRdENuqK7LYexkotEzZ8DFUi1Y+jAWGpU699EJPQwipNE5 2SWxUQk55pqB5VcL7HL22iwSrNo7Zdf74lHtWKJRfLRfPta4TzarBPxb2QG56GtR7egpJBlU4YT52 JBwyZv7m3LUbXmGuzTbrrituTBD4dsjcjIaXcembqh8UpNRnwMQiLVcMMFAuC54pKtZzzIMcrxt7/ vX9MkUCabKNK/YhmuDILfw8YtNVO1VGa5YdQgsIw0b+JHUNTtRCFs1OD/b2ArO29FrXup2glFZayJ B7C+9arQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lTpbN-0037Vn-C1; Tue, 06 Apr 2021 17:34:57 +0000 Received: from mail-db8eur05on2060.outbound.protection.outlook.com ([40.107.20.60] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lTpbI-0037VD-9e for linux-arm-kernel@lists.infradead.org; Tue, 06 Apr 2021 17:34:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NSCSbUHzp9O1Ir+pcoT91IAUUttOBRwnchJsXHCAPkyS5LP7aFq2llzFtUGuDilczniNhnGc3yzTWghFwGlDxxMWrU3+3Ok6mz4QlkqGYWXVNeAXsIdcWQXDiHbPrXx/lgOBe3ig1+bYiJXGerQLJ3iC5P2YIPebU53OIOr0qTN2nMUfZWLLMqt7C6AQapBn3wiCDjV/K24N2FrMruLMw4dmQxf62vvPa9X7w/rqtV0VxAVC9ZbC2DaA4csUtrzD7v8nHssh6bsSR6ju2YAJ3dm0kxncV7grWhn9YZptPgILUT3zxC+W95HzLE8dU2EhCKNxID9HTCwKAh5n/xt5FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CVEwpV3Iwq8fw4jadgDzeAMgjWxZo6y647OGVAthkec=; b=AfItSf4lZK1QyvpkzVNysY+ftrF+Y1s6EShXqvkDX21DE2RdNYyYU4Q1GdwV2+yKqRR6P6K2x9LdSpM2gGnpLMI9sYTgFQmns82O4ADmlpV7ALjbUPM6fxxWbJGbogIkXgQpJxNohsGEpiYTYkjEnlpkAAwE0IgV86svuYG3mYrRFewQC7G4HxRLsXnXgmOumfiMKBiqQcYEEBk0C44g8NJ/5/aZcgtxw1cQQBoJWFoXku6KGDAFMR5Yl9p2iXpuIY59WMMqU1U//lWRkvuHitvQTk8ZnGDACZFMDVC4fZRVPKdaUDQc0pOQawr7t41J+ELQNErPjRpZBOGlG8KaVw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CVEwpV3Iwq8fw4jadgDzeAMgjWxZo6y647OGVAthkec=; b=K6Qbk94StVDXRIQ8lSuEauW0CfPblnN2lVMmQhFvPbdChA9QVN2b9QqNb58v2eXf4W7fqcU6eZ/JWbqhDVlh1B9WvkaEqVoQx6+tedYjW2tzokXNkWNztppGL/VY9QVMtwbtocAQlsLvQsiyhXYWzOQQvob7YSrk2xpiVChpUQw= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=oss.nxp.com; Received: from AM5PR04MB3137.eurprd04.prod.outlook.com (2603:10a6:206:c::18) by AM6PR04MB5320.eurprd04.prod.outlook.com (2603:10a6:20b:3::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.32; Tue, 6 Apr 2021 17:34:48 +0000 Received: from AM5PR04MB3137.eurprd04.prod.outlook.com ([fe80::15d6:e539:4f60:d7df]) by AM5PR04MB3137.eurprd04.prod.outlook.com ([fe80::15d6:e539:4f60:d7df%6]) with mapi id 15.20.3955.033; Tue, 6 Apr 2021 17:34:48 +0000 From: "Mirela Rabulea (OSS)" To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: linux-imx@nxp.com, linux-media@vger.kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, robert.chiras@nxp.com, laurentiu.palcu@nxp.com, Mirela Rabulea Subject: [PATCH] media: imx-jpeg: Fix double free in mxc_jpeg_remove Date: Tue, 6 Apr 2021 20:34:28 +0300 Message-Id: <20210406173428.19283-1-mirela.rabulea@oss.nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [86.124.171.30] X-ClientProxiedBy: VI1PR07CA0283.eurprd07.prod.outlook.com (2603:10a6:800:130::11) To AM5PR04MB3137.eurprd04.prod.outlook.com (2603:10a6:206:c::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from fsr-ub1664-134.ea.freescale.net (86.124.171.30) by VI1PR07CA0283.eurprd07.prod.outlook.com (2603:10a6:800:130::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.8 via Frontend Transport; Tue, 6 Apr 2021 17:34:47 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 70b65023-dfb6-4945-8e5b-08d8f922467f X-MS-TrafficTypeDiagnostic: AM6PR04MB5320: X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: G8ijHvrIItu3hTMujdzQbs6HMJaIpt8leUusymtK7+HFFkT04S+XQuY2wfqrENXrTAnFlzcbtprJYEtj6kNmMVxtwNejxRA242O6c10N9bE38RD+nS0Z6p7nsoSFvM6auEEKre4mOS11HZUl5tFQ2XQjC2dN9ND6fu4o48Kj3zdQPzlzeg0sRDs3wWkKDLGaAEVzTUFhCOO/8aRKt+h4DfjJbc9DCEkObHItZMjTEjgYd/gZbJx/SemSdtMk46raf5WPerexPpL9ow+JNWWGFkIjL1S9LWy45T5V+KWwUUzSteb0rKLBDMUNIPDFwA+e+ECI5ASCWAirSqzwq+8r5bb0YLxPjGalqft8q8AzK4YzN1X+PGxwshzblFpzcFuKPfqDoJjJ8adKshcZfC9tApQIJX/EwgcMMC23D6lh+W5lpwwhnrHKl2isKYgDINBsttRaqlV+yQHDjYWZ/Y4C6MP6yib1vf4Eje8fsk1DVWnwlrYq/3Lcbg1G3fXkBWcJn7lpCTIOmDYVdb8asJ6OwBkT/l0GFAB5745vU2OIZGAewktgFruF7y2J8x33r9ex9nhQw5kIERy0TNcE4JMM64vPG+Tt3wOlVa31n7iqdd+hiyVydgo/+HSIACoShhOlQ1TfE1fqtYp+qxcBcgzIVaRZoolC4YLlbSt+HpJfpgI5ydYCurlnWsLSDOZVbUGJ X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM5PR04MB3137.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39850400004)(376002)(366004)(136003)(346002)(396003)(316002)(6486002)(6506007)(956004)(16526019)(186003)(66476007)(2616005)(38350700001)(8936002)(66946007)(38100700001)(26005)(83380400001)(86362001)(2906002)(52116002)(478600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ImJm1IAiMBnR/GswDwZR181C4s6q/7Pt5RDUlkS453v4aulkYhKdig2iqrYNF1Vi35zGwTspmloHPEZwH6JoKZaPZ8dhuJiWGKTpN+r8wabtT+MNqRbiTW6OEBLhCnGN4kdyCJX2TqpcTGk7+bXtg+noCnEm2Q78bAzkeMJmBMp1O/4OC348ByxrBgJr67IxQvFuE7bKDBj3X3ssp4zZ9qRNX8SZc+k+3LPcwgCy2Ew7KaPTBe7PRMVq0aFgvY6Z0qSFlXsDwviODHx4w77shBvjktI3ewjghRAJBSIoqDq4UiSwmZg/7GPJycxazI5myT+Tx89cnhnqhF5ZHOhJQ+sH2NMg2QIC+2sXFizTN X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 70b65023-dfb6-4945-8e5b-08d8f922467f X-MS-Exchange-CrossTenant-AuthSource: AM5PR04MB3137.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2021 17:34:48.2002 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: G/O1bIl1DBF+G5XfMl4W7BsnSIbfWz1xuSqwCzOOOl/5Fiat+3bXle4w0HQ9wmoSA4qtR/6MTt2MZR+9UY6s8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5320 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210406_183453_118487_F233264A X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Mirela Rabulea The video_unregister_device already calls video_device_release, so remove video_device_release, to avoid a double free, when removing the module. This showed up in a repeated rmmod/insmod scenario. Signed-off-by: Mirela Rabulea --- drivers/media/platform/imx-jpeg/mxc-jpeg.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/platform/imx-jpeg/mxc-jpeg.c b/drivers/media/platform/imx-jpeg/mxc-jpeg.c index 2d29558f1864..ca1b7e8c65f4 100644 --- a/drivers/media/platform/imx-jpeg/mxc-jpeg.c +++ b/drivers/media/platform/imx-jpeg/mxc-jpeg.c @@ -2099,7 +2099,6 @@ static int mxc_jpeg_remove(struct platform_device *pdev) mxc_jpeg_free_slot_data(jpeg, slot); video_unregister_device(jpeg->dec_vdev); - video_device_release(jpeg->dec_vdev); v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); mxc_jpeg_detach_pm_domains(jpeg);