* [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 14:05 ` Colin King
0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2021-03-02 14:05 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski, amd-gfx,
dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
checked for > 0 at the end of the function. Ret should be initialized,
I believe setting it to zero is a correct default.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 5159399f8239..5750818db8f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
{
uint8_t enable_dsc = enable ? 1 : 0;
struct amdgpu_dm_connector *aconnector;
- uint8_t ret;
+ uint8_t ret = 0;
if (!stream)
return false;
--
2.30.0
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 14:05 ` Colin King
0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2021-03-02 14:05 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski, amd-gfx,
dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
checked for > 0 at the end of the function. Ret should be initialized,
I believe setting it to zero is a correct default.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 5159399f8239..5750818db8f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
{
uint8_t enable_dsc = enable ? 1 : 0;
struct amdgpu_dm_connector *aconnector;
- uint8_t ret;
+ uint8_t ret = 0;
if (!stream)
return false;
--
2.30.0
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 14:05 ` Colin King
0 siblings, 0 replies; 9+ messages in thread
From: Colin King @ 2021-03-02 14:05 UTC (permalink / raw)
To: Harry Wentland, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski, amd-gfx,
dri-devel
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
checked for > 0 at the end of the function. Ret should be initialized,
I believe setting it to zero is a correct default.
Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 5159399f8239..5750818db8f6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
{
uint8_t enable_dsc = enable ? 1 : 0;
struct amdgpu_dm_connector *aconnector;
- uint8_t ret;
+ uint8_t ret = 0;
if (!stream)
return false;
--
2.30.0
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
2021-03-02 14:05 ` Colin King
(?)
@ 2021-03-02 15:03 ` Harry Wentland
-1 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2021-03-02 15:03 UTC (permalink / raw)
To: Colin King, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski, amd-gfx,
dri-devel
Cc: kernel-janitors, linux-kernel
On 2021-03-02 9:05 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
> SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
> checked for > 0 at the end of the function. Ret should be initialized,
> I believe setting it to zero is a correct default.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index 5159399f8239..5750818db8f6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
> {
> uint8_t enable_dsc = enable ? 1 : 0;
> struct amdgpu_dm_connector *aconnector;
> - uint8_t ret;
> + uint8_t ret = 0;
>
> if (!stream)
> return false;
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 15:03 ` Harry Wentland
0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2021-03-02 15:03 UTC (permalink / raw)
To: Colin King, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski, amd-gfx,
dri-devel
Cc: kernel-janitors, linux-kernel
On 2021-03-02 9:05 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
> SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
> checked for > 0 at the end of the function. Ret should be initialized,
> I believe setting it to zero is a correct default.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index 5159399f8239..5750818db8f6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
> {
> uint8_t enable_dsc = enable ? 1 : 0;
> struct amdgpu_dm_connector *aconnector;
> - uint8_t ret;
> + uint8_t ret = 0;
>
> if (!stream)
> return false;
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 15:03 ` Harry Wentland
0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2021-03-02 15:03 UTC (permalink / raw)
To: Colin King, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski, amd-gfx,
dri-devel
Cc: kernel-janitors, linux-kernel
On 2021-03-02 9:05 a.m., Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
> SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
> checked for > 0 at the end of the function. Ret should be initialized,
> I believe setting it to zero is a correct default.
>
> Addresses-Coverity: ("Uninitialized scalar variable")
> Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> index 5159399f8239..5750818db8f6 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
> {
> uint8_t enable_dsc = enable ? 1 : 0;
> struct amdgpu_dm_connector *aconnector;
> - uint8_t ret;
> + uint8_t ret = 0;
>
> if (!stream)
> return false;
>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
2021-03-02 15:03 ` Harry Wentland
(?)
@ 2021-03-02 17:51 ` Alex Deucher
-1 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2021-03-02 17:51 UTC (permalink / raw)
To: Harry Wentland
Cc: Colin King, Leo Li, Alex Deucher, Christian König,
David Airlie, Daniel Vetter, Anson Jacob, Mikita Lipski,
amd-gfx list, Maling list - DRI developers, kernel-janitors,
LKML
Applied. Thanks!
Alex
On Tue, Mar 2, 2021 at 10:03 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2021-03-02 9:05 a.m., Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
> > SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
> > checked for > 0 at the end of the function. Ret should be initialized,
> > I believe setting it to zero is a correct default.
> >
> > Addresses-Coverity: ("Uninitialized scalar variable")
> > Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > index 5159399f8239..5750818db8f6 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
> > {
> > uint8_t enable_dsc = enable ? 1 : 0;
> > struct amdgpu_dm_connector *aconnector;
> > - uint8_t ret;
> > + uint8_t ret = 0;
> >
> > if (!stream)
> > return false;
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 17:51 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2021-03-02 17:51 UTC (permalink / raw)
To: Harry Wentland
Cc: Anson Jacob, Leo Li, kernel-janitors, LKML, amd-gfx list,
David Airlie, Maling list - DRI developers, Alex Deucher,
Colin King, Mikita Lipski, Christian König
Applied. Thanks!
Alex
On Tue, Mar 2, 2021 at 10:03 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2021-03-02 9:05 a.m., Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
> > SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
> > checked for > 0 at the end of the function. Ret should be initialized,
> > I believe setting it to zero is a correct default.
> >
> > Addresses-Coverity: ("Uninitialized scalar variable")
> > Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > index 5159399f8239..5750818db8f6 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
> > {
> > uint8_t enable_dsc = enable ? 1 : 0;
> > struct amdgpu_dm_connector *aconnector;
> > - uint8_t ret;
> > + uint8_t ret = 0;
> >
> > if (!stream)
> > return false;
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret
@ 2021-03-02 17:51 ` Alex Deucher
0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2021-03-02 17:51 UTC (permalink / raw)
To: Harry Wentland
Cc: Anson Jacob, Leo Li, kernel-janitors, LKML, amd-gfx list,
David Airlie, Maling list - DRI developers, Daniel Vetter,
Alex Deucher, Colin King, Mikita Lipski, Christian König
Applied. Thanks!
Alex
On Tue, Mar 2, 2021 at 10:03 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2021-03-02 9:05 a.m., Colin King wrote:
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or
> > SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is
> > checked for > 0 at the end of the function. Ret should be initialized,
> > I believe setting it to zero is a correct default.
> >
> > Addresses-Coverity: ("Uninitialized scalar variable")
> > Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use")
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > index 5159399f8239..5750818db8f6 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
> > @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable(
> > {
> > uint8_t enable_dsc = enable ? 1 : 0;
> > struct amdgpu_dm_connector *aconnector;
> > - uint8_t ret;
> > + uint8_t ret = 0;
> >
> > if (!stream)
> > return false;
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2021-03-02 20:53 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02 14:05 [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret Colin King
2021-03-02 14:05 ` Colin King
2021-03-02 14:05 ` Colin King
2021-03-02 15:03 ` Harry Wentland
2021-03-02 15:03 ` Harry Wentland
2021-03-02 15:03 ` Harry Wentland
2021-03-02 17:51 ` Alex Deucher
2021-03-02 17:51 ` Alex Deucher
2021-03-02 17:51 ` Alex Deucher
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.