Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp184940iog; Sun, 12 Jun 2022 23:36:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7WjbBlLAQySsjCmm8YXk6qpS/CDECEM5nq+K75M6CtfmKXb9fe5VPHL/f3VXbpJbuYCJS X-Received: by 2002:a17:902:e54a:b0:166:50b6:a08b with SMTP id n10-20020a170902e54a00b0016650b6a08bmr51869423plf.90.1655102184476; Sun, 12 Jun 2022 23:36:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655102184; cv=none; d=google.com; s=arc-20160816; b=ToTLraDKa7hZ8gPB5XpmYz4aTARPm0nwswALL5yYtk9IThrV95PsIibNIxLon1PWJ0 H/NIFF1vT2U1CByxvGw01zUTE49PZzLc124mB6tRwYo8cQ3vw9MMZ02j3kViKEaMVWK0 MA+ZNx529sj+g+OphU4JskXVuufAEr1lO+3a6H4lIPxJmm3ST+SgeHJe36suRLMs9LXJ N9MpYzSR+zHsMgKLQVRCND/T2SMHWXLJQvSxKM669nyI4QDOBN240hBwgcTBoAdskzrb txAdInNwlQu6KxRMF0cEZQoC2pJI3k8AD7HLRGR1J9xdd9B+QVEM/wTTEiFPjSomzcNA 3BWg== 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 :message-id:date:subject:cc:to:from; bh=VzAFx6DppvtlgWJoA8PerqZXifYmjP719khHVkPqJoI=; b=kBibB2vR3xZjdXWGHI350CFOi2vyddI9k+mJ5Wv41QNLleVEdhQ7Itek0PwP841RtM fGYQ2mVCDYA58Wls2Tc/txPK7Uk+vQ78otORWbfJ4YypGuzysZgZYI2UxDoDP+Q3MMmI aKqNH2vciHtWVi70uCr/sSKMJzsakhtuB4yqYefSZ+ah5vj7dNRd7bWCl4CASIk6cVkj fltDUg6iTmI8AWFYNYk2HDtKJSAqaFLt3FPtHFqfA7pwy1ovmIOqw2UJNSRpkdu4C6Hx k1pWJgQMkpg7ga+EDx2W1bgHZEdTXNq65PX6e2c1AWVIJmGQYCPaLpMcg9/+y0ocg+sa LjgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bd10-20020a170902830a00b0015cb564e4d5si7779468plb.242.2022.06.12.23.36.10; Sun, 12 Jun 2022 23:36:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232622AbiFMGYj (ORCPT + 99 others); Mon, 13 Jun 2022 02:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231464AbiFMGYe (ORCPT ); Mon, 13 Jun 2022 02:24:34 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0869EDFEB for ; Sun, 12 Jun 2022 23:24:32 -0700 (PDT) Received: from dggpemm500021.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4LM1jz2xC7zDqtM; Mon, 13 Jun 2022 14:24:07 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500021.china.huawei.com (7.185.36.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 14:24:29 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 13 Jun 2022 14:24:29 +0800 From: Yang Yingliang To: , CC: , Subject: [PATCH -next] drm/syncobj: add missing error return code in drm_syncobj_transfer_to_timeline() Date: Mon, 13 Jun 2022 14:34:54 +0800 Message-ID: <20220613063454.2609364-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If dma_fence_unwrap_merge() fails, it should return error code in drm_syncobj_transfer_to_timeline() Fixes: ec8d985ff26f ("drm: use dma_fence_unwrap_merge() in drm_syncobj") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/gpu/drm/drm_syncobj.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_syncobj.c b/drivers/gpu/drm/drm_syncobj.c index bbad9e4696e7..0c2be8360525 100644 --- a/drivers/gpu/drm/drm_syncobj.c +++ b/drivers/gpu/drm/drm_syncobj.c @@ -874,8 +874,10 @@ static int drm_syncobj_transfer_to_timeline(struct drm_file *file_private, fence = dma_fence_unwrap_merge(tmp); dma_fence_put(tmp); - if (!fence) + if (!fence) { + ret = -ENOMEM; goto err_put_timeline; + } chain = dma_fence_chain_alloc(); if (!chain) { -- 2.25.1