Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp203449pxk; Fri, 11 Sep 2020 04:42:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxT65uC14SSZuvE6y2tq43yU8ycI7xoIU4OYpkv1nFwFMsbuvOGGQ5y/yy6x4WkkKKpZOa6 X-Received: by 2002:a17:906:1b58:: with SMTP id p24mr1711510ejg.77.1599824574958; Fri, 11 Sep 2020 04:42:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599824574; cv=none; d=google.com; s=arc-20160816; b=Et0OEyK/nIK1DYE8QMxqlngj5VMQ8+1SNrQ2FUQ4gEc7NUY4xJcbZqqiXVWE18VPxC aRnfqUUXPPdDfBIVcFBsjja0lH/oUOHRRS2PV/MIxTH/EOGxaVzv/XCeP/XQDzIxdNCO yKgEsLq0/cZ1X92D9B+nVz3BQogmIF2IhpsOVQoUfOFDqofw9ce3Oxh2hX4Ehp5xowb3 XyxOwx5NOO+lzn/Cg1LEG/NAgcEUTyhKPrJnbNjT4nLSzDEMokHmTJCnQrx6sQD8funh 2b/2pxxfXY4IrQivTnqhUCPnvGOzExavNlY1+vEjBgPKPhsjDFDc99ERQD+XPWGTCXRK aZzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=NLybTA12R49rxOGcDXibV7ZUxvhl0aTEn4tS/h14Ri4=; b=AWT9xtyc8zM9ST2erOQ0hlWHwidTZKzHu7uycspb0CNnsPy3w2xAxo596Lh5wqtsR7 LP73VOXPSIQ4+d8A3YfUNXPLW3ELyIhEYcr5ixICVF2ar5OyZIGX4wZNm/7Kp+xKepgh d5vgYOFl3VmB+nArsb/H3gm0Hd/MCHrGkDBzFeSMFZzK+9qQKCJeKYt4SvPPz3LC+onb 7Ocbw3PY8fzTMCOtXZVgFIDjRXNYnvGTV0oy2tYQ7iGlA3eZ4S/uO2Jj/tP5MukX22lb Svqp6/1fBYoNmLVgf4KmSrtjYI0Ol6U3iIoaBjSlizo24dIs5wwjPu2tcpM8UK32IS1l I9Kg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t22si1090390eji.298.2020.09.11.04.42.32; Fri, 11 Sep 2020 04:42:54 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725821AbgIKLle (ORCPT + 99 others); Fri, 11 Sep 2020 07:41:34 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:49616 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725779AbgIKLiy (ORCPT ); Fri, 11 Sep 2020 07:38:54 -0400 Received: from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 276D44D483AD00BB640F; Fri, 11 Sep 2020 19:22:11 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 19:22:01 +0800 From: Yu Kuai To: , , , , , , , , CC: , , , , , Subject: [PATCH] drm/mediatek: add missing put_device() call in mtk_drm_kms_init() Date: Fri, 11 Sep 2020 19:21:19 +0800 Message-ID: <20200911112119.3218073-1-yukuai3@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 040a8f393fe2..7aceace94ebf 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.4