The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH next] drm/xe/vf: Fix IS_ERR() vs NULL check in xe_sriov_vf_ccs_init()
@ 2025-08-01 13:32 Dan Carpenter
  2025-08-01 14:56 ` Michal Wajdeczko
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2025-08-01 13:32 UTC (permalink / raw)
  To: Satyanarayana K V P
  Cc: Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
	David Airlie, Simona Vetter, Piotr Piórkowski, Matthew Brost,
	intel-xe, dri-devel, linux-kernel, kernel-janitors

The xe_migrate_alloc() function returns NULL on error.  It doesn't return
error pointers.  Update the checking to match.

Fixes: a843b9894705 ("drm/xe/vf: Fix VM crash during VF driver release")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
index bf9fa1238462..e363240a3455 100644
--- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
+++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
@@ -271,8 +271,8 @@ int xe_sriov_vf_ccs_init(struct xe_device *xe)
 		ctx->ctx_id = ctx_id;
 
 		migrate = xe_migrate_alloc(tile);
-		if (IS_ERR(migrate)) {
-			err = PTR_ERR(migrate);
+		if (!migrate) {
+			err = -ENOMEM;
 			goto err_ret;
 		}
 
-- 
2.47.2


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

* Re: [PATCH next] drm/xe/vf: Fix IS_ERR() vs NULL check in xe_sriov_vf_ccs_init()
  2025-08-01 13:32 [PATCH next] drm/xe/vf: Fix IS_ERR() vs NULL check in xe_sriov_vf_ccs_init() Dan Carpenter
@ 2025-08-01 14:56 ` Michal Wajdeczko
  0 siblings, 0 replies; 2+ messages in thread
From: Michal Wajdeczko @ 2025-08-01 14:56 UTC (permalink / raw)
  To: Dan Carpenter, Satyanarayana K V P
  Cc: Lucas De Marchi, Thomas Hellström, Rodrigo Vivi,
	David Airlie, Simona Vetter, Piotr Piórkowski, Matthew Brost,
	intel-xe, dri-devel, linux-kernel, kernel-janitors



On 8/1/2025 3:32 PM, Dan Carpenter wrote:
> The xe_migrate_alloc() function returns NULL on error.  It doesn't return
> error pointers.  Update the checking to match.
> 
> Fixes: a843b9894705 ("drm/xe/vf: Fix VM crash during VF driver release")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>

> ---
>  drivers/gpu/drm/xe/xe_sriov_vf_ccs.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> index bf9fa1238462..e363240a3455 100644
> --- a/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> +++ b/drivers/gpu/drm/xe/xe_sriov_vf_ccs.c
> @@ -271,8 +271,8 @@ int xe_sriov_vf_ccs_init(struct xe_device *xe)
>  		ctx->ctx_id = ctx_id;
>  
>  		migrate = xe_migrate_alloc(tile);
> -		if (IS_ERR(migrate)) {
> -			err = PTR_ERR(migrate);
> +		if (!migrate) {
> +			err = -ENOMEM;
>  			goto err_ret;
>  		}
>  


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

end of thread, other threads:[~2025-08-01 14:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 13:32 [PATCH next] drm/xe/vf: Fix IS_ERR() vs NULL check in xe_sriov_vf_ccs_init() Dan Carpenter
2025-08-01 14:56 ` Michal Wajdeczko

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