[PATCH] drm/i915/selftests: Fix error pointer vs NULL in __mock_request_alloc()

Dan Carpenter dan.carpenter at linaro.org
Wed Jun 18 16:54:36 UTC 2025


On Mon, Jun 16, 2025 at 11:01:08AM -0400, Rodrigo Vivi wrote:
> On Fri, Jun 06, 2025 at 12:04:49PM +0300, Dan Carpenter wrote:
> > --- a/drivers/gpu/drm/i915/selftests/i915_request.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_request.c
> > @@ -290,7 +290,12 @@ struct smoketest {
> >  static struct i915_request *
> >  __mock_request_alloc(struct intel_context *ce)
> >  {
> > -	return mock_request(ce, 0);
> > +	struct i915_request *rq;
> > +
> > +	rq = mock_request(ce, 0);
> > +	if (!rq)
> > +		return ERR_PTR(-ENOMEM);
> 
> I believe we should fix mock_request and make it to stop replacing the
> error per NULL, and make the callers to check for IS_ERR instead of is not NULL.
> 
> Then don't need to make up an error here.
> 

Sure, can do.

regards,
dan carpenter



More information about the Intel-gfx mailing list