Commit bb6c3422 authored by Rashika Kheria's avatar Rashika Kheria Committed by Greg Kroah-Hartman

Staging: dwc2: Fix conditional statement since urb->actual_length is never less than zero.

This patch fixes the following smatch warning in hcd.c:
drivers/staging/dwc2/hcd.c:787 dwc2_assign_and_init_hc() warn: unsigned 'urb->actual_length' is never less than zero.
Signed-off-by: default avatarRashika Kheria <rashika.kheria@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f74c04d
...@@ -784,8 +784,8 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh) ...@@ -784,8 +784,8 @@ static int dwc2_assign_and_init_hc(struct dwc2_hsotg *hsotg, struct dwc2_qh *qh)
chan->data_pid_start = qh->data_toggle; chan->data_pid_start = qh->data_toggle;
chan->multi_count = 1; chan->multi_count = 1;
if ((urb->actual_length < 0 || urb->actual_length > urb->length) && if (urb->actual_length > urb->length &&
!dwc2_hcd_is_pipe_in(&urb->pipe_info)) !dwc2_hcd_is_pipe_in(&urb->pipe_info))
urb->actual_length = urb->length; urb->actual_length = urb->length;
if (hsotg->core_params->dma_enable > 0) { if (hsotg->core_params->dma_enable > 0) {
......
Markdown is supported
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