mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH][next] drm/xe: Fix uninitialized pointer def
@ 2025-02-26 16:05 Colin Ian King
  2025-02-26 16:28 ` Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Ian King @ 2025-02-26 16:05 UTC (permalink / raw)
  To: Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
	David Airlie, Simona Vetter, Jonathan Cavitt, intel-xe,
	dri-devel
  Cc: kernel-janitors, linux-kernel

In the case where a set of checks on xe->info.platform don't assign
a value to pointer def the pointer remains uninitialized and hence
can fail the following !def check. Fix this be ensuring pointer
def is initialized to NULL.

Fixes: 292b1a8a5054 ("drm/xe: Stop ignoring errors from xe_heci_gsc_init()")
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
 drivers/gpu/drm/xe/xe_heci_gsc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/xe_heci_gsc.c b/drivers/gpu/drm/xe/xe_heci_gsc.c
index 3ea325d3db99..27d11e06a82b 100644
--- a/drivers/gpu/drm/xe/xe_heci_gsc.c
+++ b/drivers/gpu/drm/xe/xe_heci_gsc.c
@@ -173,7 +173,7 @@ static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def *
 int xe_heci_gsc_init(struct xe_device *xe)
 {
 	struct xe_heci_gsc *heci_gsc = &xe->heci_gsc;
-	const struct heci_gsc_def *def;
+	const struct heci_gsc_def *def = NULL;
 	int ret;
 
 	if (!xe->info.has_heci_gscfi && !xe->info.has_heci_cscfi)
-- 
2.47.2


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

* Re: [PATCH][next] drm/xe: Fix uninitialized pointer def
  2025-02-26 16:05 [PATCH][next] drm/xe: Fix uninitialized pointer def Colin Ian King
@ 2025-02-26 16:28 ` Lucas De Marchi
  2025-02-26 18:08   ` Lucas De Marchi
  0 siblings, 1 reply; 3+ messages in thread
From: Lucas De Marchi @ 2025-02-26 16:28 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter,
	Jonathan Cavitt, intel-xe, dri-devel, kernel-janitors,
	linux-kernel

On Wed, Feb 26, 2025 at 04:05:24PM +0000, Colin Ian King wrote:
>In the case where a set of checks on xe->info.platform don't assign
>a value to pointer def the pointer remains uninitialized and hence
>can fail the following !def check. Fix this be ensuring pointer
>def is initialized to NULL.
>
>Fixes: 292b1a8a5054 ("drm/xe: Stop ignoring errors from xe_heci_gsc_init()")
>Signed-off-by: Colin Ian King <colin.i.king@gmail.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

thanks
Lucas De Marchi

>---
> drivers/gpu/drm/xe/xe_heci_gsc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_heci_gsc.c b/drivers/gpu/drm/xe/xe_heci_gsc.c
>index 3ea325d3db99..27d11e06a82b 100644
>--- a/drivers/gpu/drm/xe/xe_heci_gsc.c
>+++ b/drivers/gpu/drm/xe/xe_heci_gsc.c
>@@ -173,7 +173,7 @@ static int heci_gsc_add_device(struct xe_device *xe, const struct heci_gsc_def *
> int xe_heci_gsc_init(struct xe_device *xe)
> {
> 	struct xe_heci_gsc *heci_gsc = &xe->heci_gsc;
>-	const struct heci_gsc_def *def;
>+	const struct heci_gsc_def *def = NULL;
> 	int ret;
>
> 	if (!xe->info.has_heci_gscfi && !xe->info.has_heci_cscfi)
>-- 
>2.47.2
>

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

* Re: [PATCH][next] drm/xe: Fix uninitialized pointer def
  2025-02-26 16:28 ` Lucas De Marchi
@ 2025-02-26 18:08   ` Lucas De Marchi
  0 siblings, 0 replies; 3+ messages in thread
From: Lucas De Marchi @ 2025-02-26 18:08 UTC (permalink / raw)
  To: Colin Ian King
  Cc: Thomas Hellström, Rodrigo Vivi, David Airlie, Simona Vetter,
	Jonathan Cavitt, intel-xe, dri-devel, kernel-janitors,
	linux-kernel

On Wed, Feb 26, 2025 at 10:28:56AM -0600, Lucas De Marchi wrote:
>On Wed, Feb 26, 2025 at 04:05:24PM +0000, Colin Ian King wrote:
>>In the case where a set of checks on xe->info.platform don't assign
>>a value to pointer def the pointer remains uninitialized and hence
>>can fail the following !def check. Fix this be ensuring pointer
>>def is initialized to NULL.
>>
>>Fixes: 292b1a8a5054 ("drm/xe: Stop ignoring errors from xe_heci_gsc_init()")
>>Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
>
>
>Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>

and pushed to drm-xe-next, thanks.

Lucas De Marchi

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

end of thread, other threads:[~2025-02-26 18:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-26 16:05 [PATCH][next] drm/xe: Fix uninitialized pointer def Colin Ian King
2025-02-26 16:28 ` Lucas De Marchi
2025-02-26 18:08   ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®