Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3295975pxk; Mon, 21 Sep 2020 09:57:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRYihD1hGyJXZIxl3YJVE2Vfwsm9lwcF3ZNhzsHB9CxLdde8zeTF7pPMEUKUGLc3VN31Sw X-Received: by 2002:a17:906:2c14:: with SMTP id e20mr365323ejh.205.1600707452041; Mon, 21 Sep 2020 09:57:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600707452; cv=none; d=google.com; s=arc-20160816; b=MgI5w+V9pj9xfPaGkfsQy0vOcnREIHQutjxaVHbYPJ1FzFOtEwD4j7BLttwb0Lb8tD PoO74vP7ODAosiwjePtd6UQ463Hv5LgyeirOm9OFEZ2lk4PDGaxyj/KHrYyaEuH+NVFs CBU9nyjvjjrOI4E1375qunhzt8iUNAeV0mJg+cyDlJMyDGxztyn7oL0ekptIW//9wx9N z02+X6D4wS7YF7gCWAX31vJIl7VUMOR/M8ES5CDWdMUSoXMABxsIoljgdutuwLltMXZU KqwEm8H9li8hrW04tbGlIp7OD/tinTAq9P88UFsjCpV0ymEl3KI/i0XViZ4K11g+N2Po sEYA== 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=kSLvBF/ekfHOveweX8Lhj9Zx2ws59WgpbSQsXYdZwNE=; b=za6SPDFI7mBFgcRZBDSIdZeu1EIJW3hZEA2axHfhfwE245WK3+IbO36J1/MAWdR4OR 11r2Yp0mlRFl/swy2QclXUQYi9wkys7ebvB1Qx3GH9j/iWB8iRHbUc9hm2SMSy+J4V2i V4BF2BLO95RaTYqOsjEjg6k+M4FtrlTKcdqxBaikGZ6wvHtBjtlTv6R/FE5cVkYBATBu iT8HDU5qyIxEfDlXRzqJumdVGCGGuOJ6+orJJLxWv4BQt+Zyo4z795muOlyFMVCJzXvY omqWSebK96l2KMLRiLuvkuUsiseqbxi2XSqXStDHrwUtgmcO7VXoC1PKe1kzq5nV/EUd 0eEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wAlIV26M; 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=fail (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 o9si10151999ejr.108.2020.09.21.09.57.07; Mon, 21 Sep 2020 09:57:32 -0700 (PDT) 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=@kernel.org header.s=default header.b=wAlIV26M; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728940AbgIUQz6 (ORCPT + 99 others); Mon, 21 Sep 2020 12:55:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:51342 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727939AbgIUQp1 (ORCPT ); Mon, 21 Sep 2020 12:45:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B834C2076B; Mon, 21 Sep 2020 16:45:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706726; bh=sw/fWsgM3s2NVqfVCcC9QdPZrbGrFpV00b5iqhj5Kug=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wAlIV26MpY4Cu0dRi5i799rqZ4JCwt9QjzOqpUbt9/lhgr1aRAfN50lL6dLwY67xm I9Pgv96rlTgnbQjxDKkuCa3UHnx9f2hbV1PPrq4CMdYh3GQr+VcJGpg7jzpQO8OPtc LnWLuB0LF6PwVVv+bq2/ZeZWN+7MJpFBfgRE0ot4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yu Kuai , Chun-Kuang Hu , Sasha Levin Subject: [PATCH 5.8 070/118] drm/mediatek: Add missing put_device() call in mtk_drm_kms_init() Date: Mon, 21 Sep 2020 18:28:02 +0200 Message-Id: <20200921162039.589715174@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@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 2132940f2192824acf160d115192755f7c58a847 ] if of_find_device_by_node() succeed, mtk_drm_kms_init() doesn't have a corresponding put_device(). Thus add jump target to fix the exception handling for this function implementation. Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Yu Kuai Signed-off-by: Chun-Kuang Hu Signed-off-by: Sasha Levin --- drivers/gpu/drm/mediatek/mtk_drm_drv.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c index 7ad0433539f45..b77dc36be4224 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_drv.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c @@ -165,7 +165,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) ret = drmm_mode_config_init(drm); if (ret) - return ret; + goto put_mutex_dev; drm->mode_config.min_width = 64; drm->mode_config.min_height = 64; @@ -182,7 +182,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) ret = component_bind_all(drm->dev, drm); if (ret) - return ret; + goto put_mutex_dev; /* * We currently support two fixed data streams, each optional, @@ -229,7 +229,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) } if (!dma_dev->dma_parms) { ret = -ENOMEM; - goto err_component_unbind; + goto put_dma_dev; } ret = dma_set_max_seg_size(dma_dev, (unsigned int)DMA_BIT_MASK(32)); @@ -256,9 +256,12 @@ static int mtk_drm_kms_init(struct drm_device *drm) err_unset_dma_parms: if (private->dma_parms_allocated) dma_dev->dma_parms = NULL; +put_dma_dev: + put_device(private->dma_dev); err_component_unbind: component_unbind_all(drm->dev, drm); - +put_mutex_dev: + put_device(private->mutex_dev); return ret; } -- 2.25.1