Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2237290iof; Wed, 8 Jun 2022 00:06:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyY7vW9b/ap465pFEY//UMXdcHIKMlsDu1I81psSUXDzQtPspFB3vJuLM7J96+qONpK0pxu X-Received: by 2002:a17:903:18f:b0:167:47f3:4a with SMTP id z15-20020a170903018f00b0016747f3004amr25483679plg.70.1654671967473; Wed, 08 Jun 2022 00:06:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654671967; cv=none; d=google.com; s=arc-20160816; b=0PUKf/vNo7GDhN09cw6pzzpGintsE9cn0MC5tafvhvBSz1T1Xev/PgMm2hhcRHs2i+ Z/G5I9nNdsr6sARa63WAas/5EhIxZIEDIWHABAZa6PM+Ts4bzsLxmtKw+URBvkivlpPf Gxh1aefgV8Q0E7XpD4gRsqILfDlMjIi4m8pmvy+kqOQPRviSkzBG8TY6hmeWqGHL2CuA kLzptD4QNSYnnc+olTW9VG1wRg25hOldVB488SfDhGwFO2s1iwBmsH7aJY2zeryvdYm1 yNRMrFFmJIrP1U+PSl+Nf4W2TtbueDIPYU0L5K5Zm1qMuMMTZWi809Zj2yoRKOaNPEg4 DojQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=a16q1XfSfaOXJGBdLlLSGRwuiB3raM6grbfzCvaaQAw=; b=KCx4NUGV133u6CJHDfEvmlg5uw7nS5MbbmffpT4wTsQwg3rtLCXyjc4G+icTHjqnrw axbKBjq8cFl0PhvZ6c8vrEq0gqlYAlfcsDQJ6V4cbhD/4iyXF2EdiXeCDB4h1jTOkzgy RoNEW5z0Q1LlFZFYZ/W1MZc1TpNNpdnVmjmTv0J0QmY1DHxGJ0/0LZFgGXIdMYG2MgwF QrlWMMRhnkI1Kjjrw+EN9q0yNPOB0rCpWnLYMvoHMH08u+rakgsgDvQoYV+d6XeoFHxE 4ANUYPXP3pvtHQF7xfimuRrzZGGV3ivnlU/w7rJZWsHKtJq+WwRY+Zy6jRZSuUoKGEGw Dr0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QRdUzpvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h6-20020a056a00170600b0051bcca7d2f0si25209040pfc.306.2022.06.08.00.05.55; Wed, 08 Jun 2022 00:06:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QRdUzpvi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343835AbiFGRl4 (ORCPT + 99 others); Tue, 7 Jun 2022 13:41:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347601AbiFGRaw (ORCPT ); Tue, 7 Jun 2022 13:30:52 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6223B100524; Tue, 7 Jun 2022 10:27:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 98B95CE1D50; Tue, 7 Jun 2022 17:27:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ABFA9C385A5; Tue, 7 Jun 2022 17:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654622858; bh=G8qUnbTp31LiWUYOdhxaEF0Eo0c93bjPktO+ImQYsLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QRdUzpvi3Yu1+pWrbWBicTIZ0V8iMHhSgqWB4LcNd1WiKp7C/P87IBN/VCtHK7mG3 KRGtjEKA+MYjBjahMm6KnhZw/XCE+65AzaduIoVcDOD3oUtdR5d2R65gjUxBXSLFVX 6fyrL2sXsYPlTtH/v31xVMVJNSCa7Hq5TzbuGxqc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe JAILLET , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 209/452] media: aspeed: Fix an error handling path in aspeed_video_probe() Date: Tue, 7 Jun 2022 19:01:06 +0200 Message-Id: <20220607164914.790856395@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607164908.521895282@linuxfoundation.org> References: <20220607164908.521895282@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe JAILLET [ Upstream commit 310fda622bbd38be17fb444f7f049b137af3bc0d ] A dma_free_coherent() call is missing in the error handling path of the probe, as already done in the remove function. In fact, this call is included in aspeed_video_free_buf(). So use the latter both in the error handling path of the probe and in the remove function. It is easier to see the relation with aspeed_video_alloc_buf() this way. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Christophe JAILLET Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/aspeed-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 757a58829a51..9d9124308f6a 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -1723,6 +1723,7 @@ static int aspeed_video_probe(struct platform_device *pdev) rc = aspeed_video_setup_video(video); if (rc) { + aspeed_video_free_buf(video, &video->jpeg); clk_unprepare(video->vclk); clk_unprepare(video->eclk); return rc; @@ -1748,8 +1749,7 @@ static int aspeed_video_remove(struct platform_device *pdev) v4l2_device_unregister(v4l2_dev); - dma_free_coherent(video->dev, VE_JPEG_HEADER_SIZE, video->jpeg.virt, - video->jpeg.dma); + aspeed_video_free_buf(video, &video->jpeg); of_reserved_mem_device_release(dev); -- 2.35.1