All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <weiyongjun1@huawei.com>
To: weiyongjun1@huawei.com,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>,
	"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
	"Ye Bin" <yebin10@huawei.com>, "Likun Gao" <Likun.Gao@amd.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: <amd-gfx@lists.freedesktop.org>,
	<dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<kernel-janitors@vger.kernel.org>, Hulk Robot <hulkci@huawei.com>
Subject: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date: Mon, 24 May 2021 13:35:48 +0000	[thread overview]
Message-ID: <20210524133548.2361943-1-weiyongjun1@huawei.com> (raw)

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 49563ff87f1a..9564690b21b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 atcs:
 	/* Probe for ATCS, and initialize it if found */
 	atcs_handle = amdgpu_atcs_probe_handle(handle);
-	if (!atcs_handle)
+	if (!atcs_handle) {
+		ret = -ENODEV;
 		goto out;
+	}
 
 	atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
 	if (!atcs) {
 		DRM_WARN("Not enough memory to initialize ATCS\n");
+		ret = -ENOMEM;
 		goto out;
 	}
 	atcs->handle = atcs_handle;


WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com>
To: weiyongjun1@huawei.com,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>,
	"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
	"Ye Bin" <yebin10@huawei.com>, "Likun Gao" <Likun.Gao@amd.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Hulk Robot <hulkci@huawei.com>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date: Mon, 24 May 2021 13:35:48 +0000	[thread overview]
Message-ID: <20210524133548.2361943-1-weiyongjun1@huawei.com> (raw)

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 49563ff87f1a..9564690b21b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 atcs:
 	/* Probe for ATCS, and initialize it if found */
 	atcs_handle = amdgpu_atcs_probe_handle(handle);
-	if (!atcs_handle)
+	if (!atcs_handle) {
+		ret = -ENODEV;
 		goto out;
+	}
 
 	atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
 	if (!atcs) {
 		DRM_WARN("Not enough memory to initialize ATCS\n");
+		ret = -ENOMEM;
 		goto out;
 	}
 	atcs->handle = atcs_handle;


WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <weiyongjun1@huawei.com>
To: weiyongjun1@huawei.com,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Prike Liang" <Prike.Liang@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>,
	"Rajneesh Bhardwaj" <rajneesh.bhardwaj@amd.com>,
	"Ye Bin" <yebin10@huawei.com>, "Likun Gao" <Likun.Gao@amd.com>,
	"Fabio M. De Francesco" <fmdefrancesco@gmail.com>
Cc: Hulk Robot <hulkci@huawei.com>,
	kernel-janitors@vger.kernel.org, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init()
Date: Mon, 24 May 2021 13:35:48 +0000	[thread overview]
Message-ID: <20210524133548.2361943-1-weiyongjun1@huawei.com> (raw)

Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 77bf762f8b30 ("drm/amdgpu/acpi: unify ATCS handling (v3)")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 49563ff87f1a..9564690b21b4 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -895,12 +895,15 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
 atcs:
 	/* Probe for ATCS, and initialize it if found */
 	atcs_handle = amdgpu_atcs_probe_handle(handle);
-	if (!atcs_handle)
+	if (!atcs_handle) {
+		ret = -ENODEV;
 		goto out;
+	}
 
 	atcs = kzalloc(sizeof(*atcs), GFP_KERNEL);
 	if (!atcs) {
 		DRM_WARN("Not enough memory to initialize ATCS\n");
+		ret = -ENOMEM;
 		goto out;
 	}
 	atcs->handle = atcs_handle;

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

             reply	other threads:[~2021-05-24 13:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 13:35 Wei Yongjun [this message]
2021-05-24 13:35 ` [PATCH -next] drm/amdgpu: fix error return code in amdgpu_acpi_init() Wei Yongjun
2021-05-24 13:35 ` Wei Yongjun
2021-05-24 18:12 ` Alex Deucher
2021-05-24 18:12   ` Alex Deucher
2021-05-24 18:12   ` Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210524133548.2361943-1-weiyongjun1@huawei.com \
    --to=weiyongjun1@huawei.com \
    --cc=Likun.Gao@amd.com \
    --cc=Prike.Liang@amd.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fmdefrancesco@gmail.com \
    --cc=hulkci@huawei.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=lijo.lazar@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajneesh.bhardwaj@amd.com \
    --cc=yebin10@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.