stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
@ 2020-10-14 20:28 Alex Deucher
  2020-10-15  5:14 ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Alex Deucher @ 2020-10-14 20:28 UTC (permalink / raw)
  To: stable; +Cc: Alex Deucher

This regressed some working configurations so revert it.  Will
fix this properly for 5.9 and backport then.

This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.

This needs to be applied to 5.9 as well.  -next (5.10) has this
already, but 5.9 missed it.

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1334
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 5.9.x
(cherry picked from commit 87004abfbc27261edd15716515d89ab42198b405)
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index e4dbf14320b6..5bf4212d2857 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -796,7 +796,8 @@ static ssize_t amdgpu_set_pp_od_clk_voltage(struct device *dev,
 		tmp_str++;
 	while (isspace(*++tmp_str));
 
-	while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
+	while (tmp_str[0]) {
+		sub_str = strsep(&tmp_str, delimiter);
 		ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
 		if (ret)
 			return -EINVAL;
@@ -1066,7 +1067,8 @@ static ssize_t amdgpu_read_mask(const char *buf, size_t count, uint32_t *mask)
 	memcpy(buf_cpy, buf, bytes);
 	buf_cpy[bytes] = '\0';
 	tmp = buf_cpy;
-	while ((sub_str = strsep(&tmp, delimiter)) != NULL) {
+	while (tmp[0]) {
+		sub_str = strsep(&tmp, delimiter);
 		if (strlen(sub_str)) {
 			ret = kstrtol(sub_str, 0, &level);
 			if (ret)
@@ -1695,7 +1697,8 @@ static ssize_t amdgpu_set_pp_power_profile_mode(struct device *dev,
 			i++;
 		memcpy(buf_cpy, buf, count-i);
 		tmp_str = buf_cpy;
-		while ((sub_str = strsep(&tmp_str, delimiter)) != NULL) {
+		while (tmp_str[0]) {
+			sub_str = strsep(&tmp_str, delimiter);
 			ret = kstrtol(sub_str, 0, &parameter[parameter_size]);
 			if (ret)
 				return -EINVAL;
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
  2020-10-14 20:28 [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers" Alex Deucher
@ 2020-10-15  5:14 ` Greg KH
  2020-10-15 13:18   ` Deucher, Alexander
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2020-10-15  5:14 UTC (permalink / raw)
  To: Alex Deucher; +Cc: stable, Alex Deucher

On Wed, Oct 14, 2020 at 04:28:36PM -0400, Alex Deucher wrote:
> This regressed some working configurations so revert it.  Will
> fix this properly for 5.9 and backport then.

What do you mean "backport then"?

> 
> This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.
> 
> This needs to be applied to 5.9 as well.  -next (5.10) has this
> already, but 5.9 missed it.

What is the real fix for this?  Is it in Linus's tree and I can just
backport that fix?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
  2020-10-15  5:14 ` Greg KH
@ 2020-10-15 13:18   ` Deucher, Alexander
  2020-10-15 14:06     ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Deucher, Alexander @ 2020-10-15 13:18 UTC (permalink / raw)
  To: Greg KH, Alex Deucher; +Cc: stable

[AMD Public Use]

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Thursday, October 15, 2020 1:15 AM
> To: Alex Deucher <alexdeucher@gmail.com>
> Cc: stable@vger.kernel.org; Deucher, Alexander
> <Alexander.Deucher@amd.com>
> Subject: Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm
> sysfs handlers"
> 
> On Wed, Oct 14, 2020 at 04:28:36PM -0400, Alex Deucher wrote:
> > This regressed some working configurations so revert it.  Will fix
> > this properly for 5.9 and backport then.
> 
> What do you mean "backport then"?
> 
> >
> > This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.
> >
> > This needs to be applied to 5.9 as well.  -next (5.10) has this
> > already, but 5.9 missed it.
> 
> What is the real fix for this?  Is it in Linus's tree and I can just backport that
> fix?
> 

This is no real fix.  The revert is the fix.  Sorry, I should have clarified that.

Thanks,

Alex

> thanks,
> 
> greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
  2020-10-15 13:18   ` Deucher, Alexander
@ 2020-10-15 14:06     ` Greg KH
  2020-10-15 14:11       ` Deucher, Alexander
  0 siblings, 1 reply; 6+ messages in thread
From: Greg KH @ 2020-10-15 14:06 UTC (permalink / raw)
  To: Deucher, Alexander; +Cc: Alex Deucher, stable

On Thu, Oct 15, 2020 at 01:18:34PM +0000, Deucher, Alexander wrote:
> [AMD Public Use]
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Thursday, October 15, 2020 1:15 AM
> > To: Alex Deucher <alexdeucher@gmail.com>
> > Cc: stable@vger.kernel.org; Deucher, Alexander
> > <Alexander.Deucher@amd.com>
> > Subject: Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm
> > sysfs handlers"
> > 
> > On Wed, Oct 14, 2020 at 04:28:36PM -0400, Alex Deucher wrote:
> > > This regressed some working configurations so revert it.  Will fix
> > > this properly for 5.9 and backport then.
> > 
> > What do you mean "backport then"?
> > 
> > >
> > > This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.
> > >
> > > This needs to be applied to 5.9 as well.  -next (5.10) has this
> > > already, but 5.9 missed it.
> > 
> > What is the real fix for this?  Is it in Linus's tree and I can just backport that
> > fix?
> > 
> 
> This is no real fix.  The revert is the fix.  Sorry, I should have clarified that.

Is it also reverted in Linus's tree?  If so, what's that commit id?

If not, shouldn't it be?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
  2020-10-15 14:06     ` Greg KH
@ 2020-10-15 14:11       ` Deucher, Alexander
  2020-10-16  7:43         ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Deucher, Alexander @ 2020-10-15 14:11 UTC (permalink / raw)
  To: Greg KH; +Cc: Alex Deucher, stable

[AMD Public Use]

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Thursday, October 15, 2020 10:06 AM
> To: Deucher, Alexander <Alexander.Deucher@amd.com>
> Cc: Alex Deucher <alexdeucher@gmail.com>; stable@vger.kernel.org
> Subject: Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm
> sysfs handlers"
>
> On Thu, Oct 15, 2020 at 01:18:34PM +0000, Deucher, Alexander wrote:
> > [AMD Public Use]
> >
> > > -----Original Message-----
> > > From: Greg KH <gregkh@linuxfoundation.org>
> > > Sent: Thursday, October 15, 2020 1:15 AM
> > > To: Alex Deucher <alexdeucher@gmail.com>
> > > Cc: stable@vger.kernel.org; Deucher, Alexander
> > > <Alexander.Deucher@amd.com>
> > > Subject: Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm
> > > sysfs handlers"
> > >
> > > On Wed, Oct 14, 2020 at 04:28:36PM -0400, Alex Deucher wrote:
> > > > This regressed some working configurations so revert it.  Will fix
> > > > this properly for 5.9 and backport then.
> > >
> > > What do you mean "backport then"?
> > >
> > > >
> > > > This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.
> > > >
> > > > This needs to be applied to 5.9 as well.  -next (5.10) has this
> > > > already, but 5.9 missed it.
> > >
> > > What is the real fix for this?  Is it in Linus's tree and I can just
> > > backport that fix?
> > >
> >
> > This is no real fix.  The revert is the fix.  Sorry, I should have clarified that.
>
> Is it also reverted in Linus's tree?  If so, what's that commit id?
>
> If not, shouldn't it be?

It is reverted in Linus' tree.  I cherry-picked the revert from Linus' tree:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=87004abfbc27261edd15716515d89ab42198b405

Alex

>
> thanks,
>
> greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers"
  2020-10-15 14:11       ` Deucher, Alexander
@ 2020-10-16  7:43         ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2020-10-16  7:43 UTC (permalink / raw)
  To: Deucher, Alexander; +Cc: Alex Deucher, stable

On Thu, Oct 15, 2020 at 02:11:17PM +0000, Deucher, Alexander wrote:
> [AMD Public Use]
> 
> > -----Original Message-----
> > From: Greg KH <gregkh@linuxfoundation.org>
> > Sent: Thursday, October 15, 2020 10:06 AM
> > To: Deucher, Alexander <Alexander.Deucher@amd.com>
> > Cc: Alex Deucher <alexdeucher@gmail.com>; stable@vger.kernel.org
> > Subject: Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm
> > sysfs handlers"
> >
> > On Thu, Oct 15, 2020 at 01:18:34PM +0000, Deucher, Alexander wrote:
> > > [AMD Public Use]
> > >
> > > > -----Original Message-----
> > > > From: Greg KH <gregkh@linuxfoundation.org>
> > > > Sent: Thursday, October 15, 2020 1:15 AM
> > > > To: Alex Deucher <alexdeucher@gmail.com>
> > > > Cc: stable@vger.kernel.org; Deucher, Alexander
> > > > <Alexander.Deucher@amd.com>
> > > > Subject: Re: [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm
> > > > sysfs handlers"
> > > >
> > > > On Wed, Oct 14, 2020 at 04:28:36PM -0400, Alex Deucher wrote:
> > > > > This regressed some working configurations so revert it.  Will fix
> > > > > this properly for 5.9 and backport then.
> > > >
> > > > What do you mean "backport then"?
> > > >
> > > > >
> > > > > This reverts commit 38e0c89a19fd13f28d2b4721035160a3e66e270b.
> > > > >
> > > > > This needs to be applied to 5.9 as well.  -next (5.10) has this
> > > > > already, but 5.9 missed it.
> > > >
> > > > What is the real fix for this?  Is it in Linus's tree and I can just
> > > > backport that fix?
> > > >
> > >
> > > This is no real fix.  The revert is the fix.  Sorry, I should have clarified that.
> >
> > Is it also reverted in Linus's tree?  If so, what's that commit id?
> >
> > If not, shouldn't it be?
> 
> It is reverted in Linus' tree.  I cherry-picked the revert from Linus' tree:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=87004abfbc27261edd15716515d89ab42198b405

Ok, I've queued that one up now, can you also send me versions of this
for the older kernel trees that need it (I think 4.19.y and 5.4.y).

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-16  7:42 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 20:28 [PATCH] Revert "drm/amdgpu: Fix NULL dereference in dpm sysfs handlers" Alex Deucher
2020-10-15  5:14 ` Greg KH
2020-10-15 13:18   ` Deucher, Alexander
2020-10-15 14:06     ` Greg KH
2020-10-15 14:11       ` Deucher, Alexander
2020-10-16  7:43         ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).