diff mbox series

drm/i915/selftest: Fix an error code in live_noa_gpr()

Message ID 20200714141216.GA314989@mwanda (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftest: Fix an error code in live_noa_gpr() | expand

Commit Message

Dan Carpenter July 14, 2020, 2:12 p.m. UTC
The error code is not set on this error path.  It's either zero or
uninitialized at this point.

Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Lionel Landwerlin July 14, 2020, 2:16 p.m. UTC | #1
On 14/07/2020 17:12, Dan Carpenter wrote:
> The error code is not set on this error path.  It's either zero or
> uninitialized at this point.
>
> Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>   drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
> index deb6dec1b5ab..7aa73bb03381 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_perf.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
> @@ -329,6 +329,7 @@ static int live_noa_gpr(void *arg)
>   	cs = intel_ring_begin(rq, 2 * 32 + 2);
>   	if (IS_ERR(cs)) {
>   		i915_request_add(rq);
> +		err = PTR_ERR(cs);
>   		goto out_rq;
>   	}
>   

Looks like there is another below :

cs = intel_ring_begin(rq, 4);
if (IS_ERR(cs)) {
         i915_request_add(rq);
         goto out_rq;
}

-Lionel
Dan Carpenter July 14, 2020, 2:31 p.m. UTC | #2
On Tue, Jul 14, 2020 at 05:16:33PM +0300, Lionel Landwerlin wrote:
> On 14/07/2020 17:12, Dan Carpenter wrote:
> > The error code is not set on this error path.  It's either zero or
> > uninitialized at this point.
> > 
> > Fixes: ed2690a9ca89 ("drm/i915/selftest: Check that GPR are restored across noa_wait")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >   drivers/gpu/drm/i915/selftests/i915_perf.c | 1 +
> >   1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
> > index deb6dec1b5ab..7aa73bb03381 100644
> > --- a/drivers/gpu/drm/i915/selftests/i915_perf.c
> > +++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
> > @@ -329,6 +329,7 @@ static int live_noa_gpr(void *arg)
> >   	cs = intel_ring_begin(rq, 2 * 32 + 2);
> >   	if (IS_ERR(cs)) {
> >   		i915_request_add(rq);
> > +		err = PTR_ERR(cs);
> >   		goto out_rq;
> >   	}
> 
> Looks like there is another below :
> 
> cs = intel_ring_begin(rq, 4);
> if (IS_ERR(cs)) {
>         i915_request_add(rq);
>         goto out_rq;
> }

Oh...  Hm...  I'm looking at linux-next now and you're right.  Also
Colin already fixed the return that I fixed.  I'll resend.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/selftests/i915_perf.c b/drivers/gpu/drm/i915/selftests/i915_perf.c
index deb6dec1b5ab..7aa73bb03381 100644
--- a/drivers/gpu/drm/i915/selftests/i915_perf.c
+++ b/drivers/gpu/drm/i915/selftests/i915_perf.c
@@ -329,6 +329,7 @@  static int live_noa_gpr(void *arg)
 	cs = intel_ring_begin(rq, 2 * 32 + 2);
 	if (IS_ERR(cs)) {
 		i915_request_add(rq);
+		err = PTR_ERR(cs);
 		goto out_rq;
 	}