Skip to content
Commit 6279192a authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman
Browse files

net: ipa: fix atomic update in ipa_endpoint_replenish()

commit 6c0e3b5c

 upstream.

In ipa_endpoint_replenish(), if an error occurs when attempting to
replenish a receive buffer, we just quit and try again later.  In
that case we increment the backlog count to reflect that the attempt
was unsuccessful.  Then, if the add_one flag was true we increment
the backlog again.

This second increment is not included in the backlog local variable
though, and its value determines whether delayed work should be
scheduled.  This is a bug.

Fix this by determining whether 1 or 2 should be added to the
backlog before adding it in a atomic_add_return() call.

Reviewed-by: default avatarMatthias Kaehlcke <mka@chromium.org>
Fixes: 84f9bd12

 ("soc: qcom: ipa: IPA endpoints")
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c1f1691e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment