[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CADnq5_MquFxnRxLrfjrUL_jcj6fSi=5ymuDS5ovMRiBJH3odMw@mail.gmail.com>
Date: Mon, 8 Mar 2021 16:14:53 -0500
From: Alex Deucher <alexdeucher@...il.com>
To: "Quan, Evan" <Evan.Quan@....com>
Cc: Jia-Ju Bai <baijiaju1990@...il.com>,
"Deucher, Alexander" <Alexander.Deucher@....com>,
"Koenig, Christian" <Christian.Koenig@....com>,
"airlied@...ux.ie" <airlied@...ux.ie>,
"daniel@...ll.ch" <daniel@...ll.ch>,
"Zhang, Hawking" <Hawking.Zhang@....com>,
"Wang, Kevin(Yang)" <Kevin1.Wang@....com>,
"Gao, Likun" <Likun.Gao@....com>,
"dri-devel@...ts.freedesktop.org" <dri-devel@...ts.freedesktop.org>,
"amd-gfx@...ts.freedesktop.org" <amd-gfx@...ts.freedesktop.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] gpu: drm: swsmu: fix error return code of smu_v11_0_set_allowed_mask()
Applied. Thanks!
Alex
On Thu, Mar 4, 2021 at 11:02 PM Quan, Evan <Evan.Quan@....com> wrote:
>
> [AMD Public Use]
>
> Thanks. Reviewed-by: Evan Quan <evan.quan@....com>
>
> -----Original Message-----
> From: Jia-Ju Bai <baijiaju1990@...il.com>
> Sent: Friday, March 5, 2021 11:54 AM
> To: Deucher, Alexander <Alexander.Deucher@....com>; Koenig, Christian <Christian.Koenig@....com>; airlied@...ux.ie; daniel@...ll.ch; Quan, Evan <Evan.Quan@....com>; Zhang, Hawking <Hawking.Zhang@....com>; Wang, Kevin(Yang) <Kevin1.Wang@....com>; Gao, Likun <Likun.Gao@....com>
> Cc: amd-gfx@...ts.freedesktop.org; dri-devel@...ts.freedesktop.org; linux-kernel@...r.kernel.org; Jia-Ju Bai <baijiaju1990@...il.com>
> Subject: [PATCH] gpu: drm: swsmu: fix error return code of smu_v11_0_set_allowed_mask()
>
> When bitmap_empty() or feature->feature_num triggers an error, no error return code of smu_v11_0_set_allowed_mask() is assigned.
> To fix this bug, ret is assigned with -EINVAL as error return code.
>
> Reported-by: TOTE Robot <oslab@...nghua.edu.cn>
> Signed-off-by: Jia-Ju Bai <baijiaju1990@...il.com>
> ---
> drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
> index 90585461a56e..82731a932308 100644
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
> @@ -747,8 +747,10 @@ int smu_v11_0_set_allowed_mask(struct smu_context *smu)
> int ret = 0;
> uint32_t feature_mask[2];
>
> - if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64)
> + if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || feature->feature_num < 64) {
> + ret = -EINVAL;
> goto failed;
> + }
>
> bitmap_copy((unsigned long *)feature_mask, feature->allowed, 64);
>
> --
> 2.17.1
> _______________________________________________
> dri-devel mailing list
> dri-devel@...ts.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Powered by blists - more mailing lists