Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2536522pxk; Mon, 14 Sep 2020 16:42:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCjnlg1jsUxCbwXyptOQLKA3NJCOE8ajcrdUmSDug2Gy4YlHCtwvdHLdH/2YTt1qE3PgnX X-Received: by 2002:a17:907:6f6:: with SMTP id yh22mr17145620ejb.268.1600126931569; Mon, 14 Sep 2020 16:42:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600126931; cv=none; d=google.com; s=arc-20160816; b=QOzNe/64aBpYIpfhMI27nSn9YpAV1/Y7xRn1zSx4CtQR0eUGUCwl+eOlFnEoFrLnep xPBuG7Io58urAAMaJEAkRGtIHFUXdZ8DG/7a6RX/ZkKM7Nb+52SH2FXk01rrGRY4tm1R 43OF2FD/7j/Uwoo8lGFvsk9DkCxUHLHPvUfu1Th9o0tsa8lhrVC1SFQgxI9c3DE+6l5F Sqp3nqsvVweCmpljxrihMpeVpm//J1oVIURrPS2CcGjvf28kaDfCDLApIlUByBYWZBz4 +RQft8AtU46C3ifDHFAbrF9cmWu1zX3b4vDobHhMnPBhQeOyCxnUvVDGwGy4C2R8w6pa BLMg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=32hFp+5Nd2rOyfxn5ng+YRm8ZzOays3xqainhdycKAo=; b=V2A+LEpg+k/WgLO2zaOugkMPgIrbioiTnT14CMfSIR2k7QHwS2AMGxXoshm+er84yN oMZTLigPGuyVYaRlPNxQiUcNUg6KGlkCo60Y64QtUKOAsRUS890UYBFJhdhikTFYtJwb aUKLrsrk7/c0uTcpvoUVtPPEZT6iBztkHqEfb/8Vp5zqVxLD7M+ErJPK6x2lnD7J6Gwm 881ynKNdMPmrwMFkpWLCGmffcm3Gy4DclssSJ/4xKQ5ujPRFQbeaFJuqXnbXqiUTbzpp ruFLYZY2CH8XmTjgi6qtSlqm/iT1EyvNJuK0v0G7hEWaqyFxjVhX/mbDDWoll/DZ5VRF Bopw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=F5kaa6bD; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw15si8198746edb.299.2020.09.14.16.41.48; Mon, 14 Sep 2020 16:42:11 -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=F5kaa6bD; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726057AbgINXkm (ORCPT + 99 others); Mon, 14 Sep 2020 19:40:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:44836 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725994AbgINXkl (ORCPT ); Mon, 14 Sep 2020 19:40:41 -0400 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BBF6E21D7A for ; Mon, 14 Sep 2020 23:40:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600126840; bh=7YxhV2xZvx6nrVGCgI8yLCt9xE01+z6rpckv6HeDiOE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=F5kaa6bDRZsnqgJGDMMmyNFrKwzGHueqBd6WRKMgYu9urtYGZwverk0IH0Rhg7VEB rH8RmZ+WayMCTXd+FI77zXckVabDIWc6xRMn4rIKVV+WOc6d1tKVajNp1PuCl+KMAU CQf0DVw7gP2BTeslaKe2/Fqfk4CW/GcaYQqM9fdY= Received: by mail-ed1-f48.google.com with SMTP id k14so1287060edo.1 for ; Mon, 14 Sep 2020 16:40:39 -0700 (PDT) X-Gm-Message-State: AOAM530hOdPEdnnkG5AQS/qKUelrSmFRu7Hjss1bKYQUr9sWHPM2QH6g 0LfFg01XXa2xBhensBum0OM+Lo6C4BpGgHEUHA== X-Received: by 2002:a50:cbc7:: with SMTP id l7mr19619839edi.148.1600126838289; Mon, 14 Sep 2020 16:40:38 -0700 (PDT) MIME-Version: 1.0 References: <20200911112119.3218073-1-yukuai3@huawei.com> In-Reply-To: <20200911112119.3218073-1-yukuai3@huawei.com> From: Chun-Kuang Hu Date: Tue, 15 Sep 2020 07:40:28 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/mediatek: add missing put_device() call in mtk_drm_kms_init() To: Yu Kuai Cc: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , djkurtz@chromium.org, yt.shen@mediatek.com, CK Hu , littlecvr@chromium.org, DRI Development , Linux ARM , "moderated list:ARM/Mediatek SoC support" , linux-kernel , yi.zhang@huawei.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yu Kuai: Yu Kuai =E6=96=BC 2020=E5=B9=B49=E6=9C=8811=E6=97=A5 = =E9=80=B1=E4=BA=94 =E4=B8=8B=E5=8D=887:22=E5=AF=AB=E9=81=93=EF=BC=9A > > 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. Reviewed-by: Chun-Kuang Hu > > Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT817= 3.") > 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/med= iatek/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 =3D drmm_mode_config_init(drm); > if (ret) > - return ret; > + goto put_mutex_dev; > > drm->mode_config.min_width =3D 64; > drm->mode_config.min_height =3D 64; > @@ -182,7 +182,7 @@ static int mtk_drm_kms_init(struct drm_device *drm) > > ret =3D 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 =3D -ENOMEM; > - goto err_component_unbind; > + goto put_dma_dev; > } > > ret =3D 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 =3D 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 >