Skip to content

Commit

Permalink
usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
Browse files Browse the repository at this point in the history
We can't assign -EINVAL to a u16.

Fixes: 3948f0e ('usb: add Freescale QE/CPM USB peripheral controller driver')
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
  • Loading branch information
Dan Carpenter authored and Felipe Balbi committed Aug 22, 2016
1 parent 80d1642 commit f4693b0
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/usb/gadget/udc/fsl_qe_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1878,11 +1878,8 @@ static int qe_get_frame(struct usb_gadget *gadget)

tmp = in_be16(&udc->usb_param->frame_n);
if (tmp & 0x8000)
tmp = tmp & 0x07ff;
else
tmp = -EINVAL;

return (int)tmp;
return tmp & 0x07ff;
return -EINVAL;
}

static int fsl_qe_start(struct usb_gadget *gadget,
Expand Down

0 comments on commit f4693b0

Please sign in to comment.