From: Alex Elder Date: Tue, 19 Jul 2022 18:10:18 +0000 (-0500) Subject: net: ipa: skip some cleanup for unused transactions X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=4d8996cbeeabba028714d0e0bd5957b5515cae43;p=linux.git net: ipa: skip some cleanup for unused transactions 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 Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ipa/gsi_trans.c b/drivers/net/ipa/gsi_trans.c index 3f52932e9e413..55987e35af2dd 100644 --- a/drivers/net/ipa/gsi_trans.c +++ b/drivers/net/ipa/gsi_trans.c @@ -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.