Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp963800pxb; Sun, 7 Mar 2021 01:27:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoc+tfdTn0Jd3RA9zijNOBCSUrSCu8PsVxoc/Dm+RTrmbjZDO+zq0TaX+7C2kX3Hu47muO X-Received: by 2002:aa7:d445:: with SMTP id q5mr16924466edr.382.1615109246019; Sun, 07 Mar 2021 01:27:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615109246; cv=none; d=google.com; s=arc-20160816; b=ObHezkqeMylSq+YnU2ja9M7jMI38/Jz/ZUyKxivqvBgzWY1XJDGisdz2GkQLHn9lwA iP9Cx2yBMM65oJtDui779Yxq7aNstzxq3BVxDXGgG92SnzRBHs1UgeOhiRVVBbyRS6MP K2ch7JTIgYWrYUUThxUkD4c9iuy3BiFf9qbRdWd5+KAYBarcekyrfSn7sVbrXjGWVfsf N9giqG8xlpXTiz0WIjx0RBkE07iOH20O0lF+kAKeOcxuFcFeSuj1qeICahFg+houg5ee xfqr/0DEWokSz/3yTlqE+VrVugp9jOqdYe3RkiWJk1bx2PwTfWSQpnjpX8DvjYzSuj14 TfgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=c4bUo1XFYPqAeWFc5nQ4FKN414jxkX238K1R/ykzSZ0=; b=yldZQvnLKWi0+2gK6ed17AuRqu/kTauJNoFu5w7Gztcc2RnC+d7/1F7mWaPNDRfgvR JnU73Dq4I0QoaXnfchv6PUM/9iLpmVyznV32LrmruqHb1rWN7DRep6F8TDg/m/fTdpRT RS9iqq0TyQxrO9wQOiGLy7GcNGg95tMTcy8JB0o8FlS3M0A/h9/JYy38b9qDL36RF1Wv JjtkEI2JfjEFgk41RRySNJclpUUE6UmZxapUM4Xb1JZIAAhtTAzr8SHWggNrnXtTSpCF oxh/q/lv4kHp71kxOJ384LIvPn5LBJTAlflCLBF+eSZUwrQ9jfSwYDYsvVkGBx8uTR/O lxXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=D7UhJ7En; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o9si4862381edh.236.2021.03.07.01.27.02; Sun, 07 Mar 2021 01:27:26 -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=@gmail.com header.s=20161025 header.b=D7UhJ7En; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231386AbhCGJVH (ORCPT + 99 others); Sun, 7 Mar 2021 04:21:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230070AbhCGJUd (ORCPT ); Sun, 7 Mar 2021 04:20:33 -0500 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB8ABC06174A for ; Sun, 7 Mar 2021 01:20:33 -0800 (PST) Received: by mail-pg1-x530.google.com with SMTP id o38so4426950pgm.9 for ; Sun, 07 Mar 2021 01:20:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=c4bUo1XFYPqAeWFc5nQ4FKN414jxkX238K1R/ykzSZ0=; b=D7UhJ7EnN9e5KT1lZ91iZj61RL26XDi8obkAgdhqzDnNcwkKNLsaf8VqM3RWRjtWt5 OdPE8Bc2svyUlL1HrlfidK5ckxDvUAqoVtXcGzvRKCiXXYMeG1K57dunTWAtcY9u5NGR MczLfdo6LenbQugvzgRKNStdiXaObz5Du/XvUzxkic0qsOzctUgB4IfA0Ed3/psuU4VK gJbl7EET9zA2itrQEFE+Vip00b8UNbLXLufTw3KOWrPXcE2YroffGvC6oqdJ/1HzFTYJ gnmBpnURiqgSCjxKezNt8vtmq20VB8Sg7zxDRoTuUHUJzo2Ep0qMQGqrjPY/uzreQSCF N24g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=c4bUo1XFYPqAeWFc5nQ4FKN414jxkX238K1R/ykzSZ0=; b=oR/5YEqi7Udqhl8tPK/OHWqqR2elNnVUlxxeBxS45TF42eOf89qYVi99m/IJkSxf/d Qt3PHbGvU04fi2VFNG2DvDNHqr2gnvDy8/1NDPCh55su2AwTC8lujxffIeJlJXHVxtW0 gwO2ozupMMEy4CHQMloxAriKOWLwvVLeO5zZb+GPvH+ZuEULhB1u6/QlBIkEzc5E1ABj RU9x7pWSIGEKtyHpN99eege3zGg5XbWQiry1lJlEMZoV+w7/3krOR4wWlHgDcuvpmI5f u9GU3ITg4sGsYkWohrcD+4oULK4dCSena/VhtSOpjRtvl2PRxFBoV8fLmYgADI5hjltm fGfA== X-Gm-Message-State: AOAM531Jp+fGWvB7XFl1zFQLdEmZ3GauKGRcL9h6GC3/Km31cRfluhdN +WmWZFgddS6IwYVVw6vg6Pw= X-Received: by 2002:a63:e109:: with SMTP id z9mr15927732pgh.5.1615108833244; Sun, 07 Mar 2021 01:20:33 -0800 (PST) Received: from localhost.localdomain ([45.135.186.66]) by smtp.gmail.com with ESMTPSA id o3sm6825678pgm.60.2021.03.07.01.20.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Mar 2021 01:20:32 -0800 (PST) From: Jia-Ju Bai To: alexander.deucher@amd.com, christian.koenig@amd.com, airlied@linux.ie, daniel@ffwll.ch, yebin10@huawei.com, luben.tuikov@amd.com, Likun.Gao@amd.com, Prike.Liang@amd.com, avg@FreeBSD.org Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] gpu: drm: amd: amdgpu: fix error return code of amdgpu_acpi_init() Date: Sun, 7 Mar 2021 01:20:10 -0800 Message-Id: <20210307092010.23117-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add error return code in error hanlding code of amdgpu_acpi_init(). Reported-by: TOTE Robot Signed-off-by: Jia-Ju Bai --- drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c index 8155c54392c8..156f30d5a2c0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c @@ -788,12 +788,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev) /* Probe for ATIF, and initialize it if found */ atif_handle = amdgpu_atif_probe_handle(handle); - if (!atif_handle) + if (!atif_handle) { + ret = -EINVAL; goto out; + } atif = kzalloc(sizeof(*atif), GFP_KERNEL); if (!atif) { DRM_WARN("Not enough memory to initialize ATIF\n"); + ret = -ENOMEM; goto out; } atif->handle = atif_handle; @@ -803,6 +806,7 @@ int amdgpu_acpi_init(struct amdgpu_device *adev) if (ret) { DRM_DEBUG_DRIVER("Call to ATIF verify_interface failed: %d\n", ret); kfree(atif); + ret = -EINVAL; goto out; } adev->atif = atif; -- 2.17.1