Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9430568pxu; Mon, 28 Dec 2020 16:16:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXAKPU0w/pVUSzMCeEZVPMC6ONrS9XXrXGNh/GsEDVfdlDc4AyNwcrpoJW4+nDMBs0Om3e X-Received: by 2002:a17:906:720e:: with SMTP id m14mr41867197ejk.161.1609200987813; Mon, 28 Dec 2020 16:16:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609200987; cv=none; d=google.com; s=arc-20160816; b=U3U2WN70PVPyKNWw8XUBm4Cpg6igUwBxt2hy0L2jBdj7mI11yc23USvjywfiqKm6He otCHeTrcJpX5C7Jf8gz05BHUiFjv4vyN6m3ngAF819lPEPOMPgEnch3MKOAqfjqIHrG4 6JG0XdKZOvw2FrO114B/o4U1OkoEngoVyhueW1h4Uzs+3xMGtr1Srov0yVcW5sMOpnv1 WcGGHcokit/hsFcwRtmFbDO4PDXHvg6458QniYAdS/OJbuIdGeLn3nNMMlXf4NA2ehUZ EZYVjeJxuH/MoGiTbl1Xxz1AcD8vVw6k0xRO25ldqWomXlCuXEtnJiwonR+SI9ey/5Nx zNzw== 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=jF38jAMtRrO1nKc4eup4PDh1uSsKgS2cs4MRBp9av5k=; b=EhkKVzNPeCzWoMIV3Eg1CCYnvuRT5cK3ZLudw8Z5iRakWla2Ih3q7nrzeONEV2Jtwc rHSV0zNyZrg8+cXJ8Lo4XBep5a0dfIj2rT/6Zo30YTdSIvpIHCTBu5qtMETMUbOlYB0C qx57NRXjJOocXnPNwRvKF0P5t1VT45lZoVlK5QM1Vd9H54C83kU5mSPStmHE9v1iWW7K j+9j8Ji20QI5uUY9QI/9YK//E9tR+gGPrSZBVZM5jcLmxvd68IrH/P8rXD+c9tYuvvKb +wfdDd0xABe+6XIaDfh6X9pV7IwAbDU4QLXIyB8ZJ1wdAGCx+kDEJY/OKc5IIJy9OuT0 txAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=negabh9I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p26si18749232eja.49.2020.12.28.16.16.06; Mon, 28 Dec 2020 16:16:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=negabh9I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2392482AbgL1PRC (ORCPT + 99 others); Mon, 28 Dec 2020 10:17:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:38700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437430AbgL1OEk (ORCPT ); Mon, 28 Dec 2020 09:04:40 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8C859207B6; Mon, 28 Dec 2020 14:04:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164265; bh=q9UHE/jghekoTwyREwTZUqFmidHEY1kTRxGvPYx6XgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=negabh9ILN7IEZmJrFIlyunlIUe41I9riEa/S07Vct4r8rrvrmuvVWxEFZK2ZkfX/ xYVbUKgpbwhP8QZW7HQiy+8K3WpBq3oCHQYM3zhOg2HtY/PtAIApwHcoUveOb2eh39 +FDE7Zn84yzBV5p69+AeA3zRXHb+NGROibYlPBZo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.10 120/717] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm() Date: Mon, 28 Dec 2020 13:41:58 +0100 Message-Id: <20201228125026.711782945@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Kuai [ Upstream commit 5d4fa2c50125c9cda9e380d89268757cc5fa743d ] if of_find_device_by_node() succeed, mtk_vcodec_init_dec_pm() doesn't have a corresponding put_device(). Thus add jump target to fix the exception handling for this function implementation. Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver") Signed-off-by: Yu Kuai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- .../platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c index 36dfe3fc056a4..f6a6b42865fbd 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c @@ -47,11 +47,14 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev) dec_clk->clk_info = devm_kcalloc(&pdev->dev, dec_clk->clk_num, sizeof(*clk_info), GFP_KERNEL); - if (!dec_clk->clk_info) - return -ENOMEM; + if (!dec_clk->clk_info) { + ret = -ENOMEM; + goto put_device; + } } else { mtk_v4l2_err("Failed to get vdec clock count"); - return -EINVAL; + ret = -EINVAL; + goto put_device; } for (i = 0; i < dec_clk->clk_num; i++) { @@ -60,19 +63,22 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev) "clock-names", i, &clk_info->clk_name); if (ret) { mtk_v4l2_err("Failed to get clock name id = %d", i); - return ret; + goto put_device; } clk_info->vcodec_clk = devm_clk_get(&pdev->dev, clk_info->clk_name); if (IS_ERR(clk_info->vcodec_clk)) { mtk_v4l2_err("devm_clk_get (%d)%s fail", i, clk_info->clk_name); - return PTR_ERR(clk_info->vcodec_clk); + ret = PTR_ERR(clk_info->vcodec_clk); + goto put_device; } } pm_runtime_enable(&pdev->dev); - + return 0; +put_device: + put_device(pm->larbvdec); return ret; } -- 2.27.0