If wait_for_completion_interruptible_timeout returns a positive value
it may be propagated as the return value of _dln2_transfer. This
contradicts the documentation of the function and exposes unnecessary
internals to the callers.
This patch makes sure to set the return value to 0 in that case.
Reported-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Octavian Purdila <octavian.purdila@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
                if (!ret)
                        ret = -ETIMEDOUT;
                goto out_free_rx_slot;
+       } else {
+               ret = 0;
        }
 
        if (dln2->disconnect) {
                goto out_free_rx_slot;
        }
 
-       if (!ibuf) {
-               ret = 0;
+       if (!ibuf)
                goto out_free_rx_slot;
-       }
 
        if (*ibuf_len > rsp->hdr.size - sizeof(*rsp))
                *ibuf_len = rsp->hdr.size - sizeof(*rsp);