Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9079014pxu; Mon, 28 Dec 2020 06:08:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyQZIQpGjbsIs8SYQZgdVHI7mba78cz5oEAYMXQ4gDlCVnhulYVNML1ZCJh0EKFlZD1/Tkg X-Received: by 2002:a17:906:4443:: with SMTP id i3mr39167641ejp.133.1609164517890; Mon, 28 Dec 2020 06:08:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609164517; cv=none; d=google.com; s=arc-20160816; b=MwnOxKswY4p9pEGu5LM2itk0hElO2ktKbpCDfD0QusN/bjlXun9PFYgp3wpAzGlLmg fAaIPQKZi42nC09dZSu2W+ghqOXFqk8BVMFaPh818upIJuvAKpuraAEv0DzB7AB0DMPK QDz1Iz4apG5Ha3VTW4Q27Ka52onAXeL26Ste+CrMExLfKx4440b5y64Ww9RZ81v4Fv7U 9yNIRQvsf+852wx/UZ+sT/QK9oeQnQ6FtxW9Dv8cr9jlisLhap2xmYA1hVUpGobnikSI ALHXwzklk4Vxvp13Y0Fwrce2BhyvAzcupbedQgPLPr4TlGgZhQXdGY2C83a7LvmWGWlM BgDw== 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=UE6wGM06LXIggXneOKYAKdXZhQNrXpBMLcsND/fy3B8=; b=vJmOKGM/7YW/dcEgC/9jKJ3O6hZWPVRMIG3ggTD76u/3AW2E+HyGzazkjhW8yOJyYR lDZNudDEq6tS/okXtLa+S0qR3CBkd/TgQ1eDuFXcfQ5W0m2sipeVuUiqKgdK/QER4D7O b0yV4oA0lFV5GmMdGJNcD1w+8SxiIP26V9LK8fQ8ek9mvq/ZX2mHlKgqkOt1m7OQ1zBg dx6JY1jy45trJVb33U2cgVsyQHN/OJQxjWYxraR6oS5pbFK2G715qP0nN8bKg9JZce+D Y44+nXsdtmoSpqevovTqfoFq3FKrQGeQL4SHQYKOcvSBCe0E2jTwDPOBfQCheFBqEpOn +1oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j0tiYDuV; 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 di13si19959094edb.412.2020.12.28.06.08.13; Mon, 28 Dec 2020 06:08:37 -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=j0tiYDuV; 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 S2437553AbgL1OFG (ORCPT + 99 others); Mon, 28 Dec 2020 09:05:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:39106 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437532AbgL1OFG (ORCPT ); Mon, 28 Dec 2020 09:05:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 397F2206E5; Mon, 28 Dec 2020 14:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164290; bh=hwmcmGIyo9MKZsDK2ej6AsRvBoISgFkZALkHMfkTwKM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j0tiYDuVvBZJDnmU0GMBUoLZCcsU/YDy5jCvz3piCgqj24liUUPB/zwY374WCgG9k 5O0GWktIw0/5rUZISN4BjObJ3LBGDerJULGG9zAgx5pvDk9380ZFU9z5V61E+PaGhB vTPikmQ7ODL1SQxVl76Xt1rlKT1PNOnNWMyoVvCg= 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 128/717] media: platform: add missing put_device() call in mtk_jpeg_probe() and mtk_jpeg_remove() Date: Mon, 28 Dec 2020 13:42:06 +0100 Message-Id: <20201228125027.081282909@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 0d72f489995bb8565f6fe30539d4504c88356a9e ] if mtk_jpeg_clk_init() succeed, mtk_jpeg_probe() and mtk_jpeg_remove() doesn't have a corresponding put_device(). Thus add a new helper mtk_jpeg_clk_release() to fix it. Fixes: b2f0d2724ba4 ("[media] vcodec: mediatek: Add Mediatek JPEG Decoder Driver") Signed-off-by: Yu Kuai Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c index 106543391c460..88a23bce569d9 100644 --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c @@ -1332,6 +1332,12 @@ static void mtk_jpeg_job_timeout_work(struct work_struct *work) v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_ERROR); v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx); } + +static inline void mtk_jpeg_clk_release(struct mtk_jpeg_dev *jpeg) +{ + put_device(jpeg->larb); +} + static int mtk_jpeg_probe(struct platform_device *pdev) { struct mtk_jpeg_dev *jpeg; @@ -1436,6 +1442,7 @@ err_m2m_init: v4l2_device_unregister(&jpeg->v4l2_dev); err_dev_register: + mtk_jpeg_clk_release(jpeg); err_clk_init: @@ -1453,6 +1460,7 @@ static int mtk_jpeg_remove(struct platform_device *pdev) video_device_release(jpeg->vdev); v4l2_m2m_release(jpeg->m2m_dev); v4l2_device_unregister(&jpeg->v4l2_dev); + mtk_jpeg_clk_release(jpeg); return 0; } -- 2.27.0