Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2165919iof; Tue, 7 Jun 2022 21:56:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyjE9SzLU0gMUYoWSynQDpClrpTlI4to0DDz8spuF8hEz5Zq1C3H2JRuD+ZWvUUEduUQ0Lr X-Received: by 2002:a65:6c0a:0:b0:3fa:c20c:cbe7 with SMTP id y10-20020a656c0a000000b003fac20ccbe7mr27984586pgu.611.1654664202974; Tue, 07 Jun 2022 21:56:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654664202; cv=none; d=google.com; s=arc-20160816; b=WZMJ+N7N2DYDxaECre0SOu15pJzM+7BqvUNWovt4k0u9iFBY4xWoQ/sO7QVP9Go5it kZ8p+pQe3h1lwBuwcsG0IgsU2l0LPwlvedw2cfEmI1HlMNLoMtANtFtpQey6dFavKrFC bHVYSABPg2Mwx8G6WWMBxwhE5bwKix3/7SYehLS7qOZ9ja6ctTTYd+rjMovYYIZ5QBru 2XTJYOKZcZxyDa2BmHPuqxrPsuE48TulUnlfe20NjUU79GyhEyzgw7eUqD4ZjxyViZwN +6BgImkL58f1NthBw2sH3DJh6kqRjAoNnl48pE2Pj2MqJwLQ24lPEJtfcDnxJwxdvz8h gvAA== 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=bsapGLiHAFTwkquFRL6f85gnB46gsRmA6eHKQERSaZ8=; b=uOg3M5zWrf0SO4BY5Jv8DycUaDqizdY6xtn0Ukw5lAY47q4QkFBktEL7Vm/JVep1HF LFizxaMnAXg8pB2I9vH0rUri87of4Bri6kITholSvrn5fOlUyDEiI02MPln60J/hBdtJ SBB0+0x7OZcBpbxfhX7YtuTjLNIxKINFwJiHtYRuIwa43IdzonFBdKEwsMD8J5MZGF0i x2uMbF5wlZaEUoDesnDTInDovRSIoshv/Yrx9wPZ4z1FIwZm425T17aGxdmx35maYl2w r2OylfPWe6hA19mN7+ny67eKyc5YNq/NwHXbs7z5baiRKWZ2a8r3mhf93TsnIb0n4i0u kXew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ng4uUBx3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id bg9-20020a056a02010900b003fa4c706645si12544278pgb.791.2022.06.07.21.56.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 21:56:42 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Ng4uUBx3; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6A3A746224E; Tue, 7 Jun 2022 21:32:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385819AbiFGWrD (ORCPT + 99 others); Tue, 7 Jun 2022 18:47:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1380686AbiFGVhz (ORCPT ); Tue, 7 Jun 2022 17:37:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5C54EAD2F; Tue, 7 Jun 2022 12:05:07 -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 dfw.source.kernel.org (Postfix) with ESMTPS id C9F2761853; Tue, 7 Jun 2022 19:05:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D65DDC385A2; Tue, 7 Jun 2022 19:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654628706; bh=B3rO21cPkyhp2+ZYKxUS2eTgGKkaeRxJgR4ZPsVHMak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ng4uUBx3gKatXSMYmdIebkOIM5BC4ovl+/MnVO61PeYlnQLaAiNhPRSlkbXJL+9aU wuM8IZRr+j1KiFZEZzzfXT1ht7e58SpXNz/yah2TwyC7oc8ELtvyiZ0Ve4g8S4OsRt ISYzv31lHlUBKuWBzDnYLvU3EDf6+nbFn+lmKYBA= 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.18 427/879] media: aspeed: Fix an error handling path in aspeed_video_probe() Date: Tue, 7 Jun 2022 18:59:05 +0200 Message-Id: <20220607165015.260594975@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/aspeed-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/aspeed/aspeed-video.c b/drivers/media/platform/aspeed/aspeed-video.c index b937dbcbe9e0..20f795ccc11b 100644 --- a/drivers/media/platform/aspeed/aspeed-video.c +++ b/drivers/media/platform/aspeed/aspeed-video.c @@ -1993,6 +1993,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; @@ -2024,8 +2025,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