> mana_ib_post_send() returns err after walking the send work request list.
> If the caller passes an empty list, the loop is skipped and err is not
> assigned.
>
> Initialize err to 0 so an empty send work request list returns success
> instead of
> stack data.
>
> Fixes: c8017f5b4856 ("RDMA/mana_ib: UD/GSI work requests")
> Signed-off-by: Ruoyu Wang <[email protected]>
Reviewed-by: Long Li <[email protected]>
> ---
> v2:
> - Split the erdma and mana_ib changes into separate patches.
> - Add a driver-specific Fixes tag.
>
> drivers/infiniband/hw/mana/wr.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/infiniband/hw/mana/wr.c b/drivers/infiniband/hw/mana/wr.c
> index 1813567d3b16c..36a1d506f08f6 100644
> --- a/drivers/infiniband/hw/mana/wr.c
> +++ b/drivers/infiniband/hw/mana/wr.c
> @@ -144,7 +144,7 @@ static int mana_ib_post_send_ud(struct mana_ib_qp
> *qp, const struct ib_ud_wr *wr int mana_ib_post_send(struct ib_qp *ibqp,
> const struct ib_send_wr *wr,
> const struct ib_send_wr **bad_wr) {
> - int err;
> + int err = 0;
> struct mana_ib_qp *qp = container_of(ibqp, struct mana_ib_qp, ibqp);
>
> for (; wr; wr = wr->next) {
> --
> 2.51.0