Skip to content

Commit

Permalink
net: ipa: skip some cleanup for unused transactions
Browse files Browse the repository at this point in the history
In gsi_trans_free(), there's no point in ipa_gsi_trans_release() if
a transaction is unused.  No used TREs means no IPA layer resources
to clean up.  So only call ipa_gsi_trans_release() if at least one
TRE was used.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Alex Elder authored and Jakub Kicinski committed Jul 21, 2022
1 parent 4920065 commit 4d8996c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ipa/gsi_trans.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@ void gsi_trans_free(struct gsi_trans *trans)
if (!last)
return;

ipa_gsi_trans_release(trans);
if (trans->used_count)
ipa_gsi_trans_release(trans);

/* Releasing the reserved TREs implicitly frees the sgl[] and
* (if present) info[] arrays, plus the transaction itself.
Expand Down

0 comments on commit 4d8996c

Please sign in to comment.