File tree Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Expand file tree Collapse file tree 1 file changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -5795,26 +5795,29 @@ static int indirect_ctx_bb_check(struct intel_context *ce)
5795
5795
static int __live_lrc_indirect_ctx_bb (struct intel_engine_cs * engine )
5796
5796
{
5797
5797
struct intel_context * a , * b ;
5798
- int err = 0 ;
5798
+ int err ;
5799
5799
5800
5800
a = intel_context_create (engine );
5801
- b = intel_context_create ( engine );
5802
-
5801
+ if ( IS_ERR ( a ))
5802
+ return PTR_ERR ( a );
5803
5803
err = intel_context_pin (a );
5804
5804
if (err )
5805
- return err ;
5805
+ goto put_a ;
5806
5806
5807
- err = intel_context_pin ( b );
5808
- if (err ) {
5809
- intel_context_put ( a );
5810
- return err ;
5807
+ b = intel_context_create ( engine );
5808
+ if (IS_ERR ( b ) ) {
5809
+ err = PTR_ERR ( b );
5810
+ goto unpin_a ;
5811
5811
}
5812
+ err = intel_context_pin (b );
5813
+ if (err )
5814
+ goto put_b ;
5812
5815
5813
5816
/* We use the already reserved extra page in context state */
5814
5817
if (!a -> wa_bb_page ) {
5815
5818
GEM_BUG_ON (b -> wa_bb_page );
5816
5819
GEM_BUG_ON (INTEL_GEN (engine -> i915 ) == 12 );
5817
- goto out ;
5820
+ goto unpin_b ;
5818
5821
}
5819
5822
5820
5823
/*
@@ -5829,14 +5832,17 @@ static int __live_lrc_indirect_ctx_bb(struct intel_engine_cs *engine)
5829
5832
5830
5833
err = indirect_ctx_bb_check (a );
5831
5834
if (err )
5832
- goto out ;
5835
+ goto unpin_b ;
5833
5836
5834
5837
err = indirect_ctx_bb_check (b );
5835
- out :
5838
+
5839
+ unpin_b :
5836
5840
intel_context_unpin (b );
5841
+ put_b :
5837
5842
intel_context_put (b );
5838
-
5843
+ unpin_a :
5839
5844
intel_context_unpin (a );
5845
+ put_a :
5840
5846
intel_context_put (a );
5841
5847
5842
5848
return err ;
You can’t perform that action at this time.
0 commit comments