diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-07-15 07:15:47 -0400 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-08-22 03:45:12 -0400 |
commit | f4693b08cc901912a87369c46537b94ed4084ea0 (patch) | |
tree | abb1fb8d5e66caf9ec67ab08d774fa78d0ad72ef | |
parent | 80d1642d7640ef00d8823f17a529785331aceb96 (diff) |
usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
We can't assign -EINVAL to a u16.
Fixes: 3948f0e0c999 ('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>
-rw-r--r-- | drivers/usb/gadget/udc/fsl_qe_udc.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/usb/gadget/udc/fsl_qe_udc.c b/drivers/usb/gadget/udc/fsl_qe_udc.c index cf8819a5c5b2..8bb011ea78f7 100644 --- a/drivers/usb/gadget/udc/fsl_qe_udc.c +++ b/drivers/usb/gadget/udc/fsl_qe_udc.c | |||
@@ -1878,11 +1878,8 @@ static int qe_get_frame(struct usb_gadget *gadget) | |||
1878 | 1878 | ||
1879 | tmp = in_be16(&udc->usb_param->frame_n); | 1879 | tmp = in_be16(&udc->usb_param->frame_n); |
1880 | if (tmp & 0x8000) | 1880 | if (tmp & 0x8000) |
1881 | tmp = tmp & 0x07ff; | 1881 | return tmp & 0x07ff; |
1882 | else | 1882 | return -EINVAL; |
1883 | tmp = -EINVAL; | ||
1884 | |||
1885 | return (int)tmp; | ||
1886 | } | 1883 | } |
1887 | 1884 | ||
1888 | static int fsl_qe_start(struct usb_gadget *gadget, | 1885 | static int fsl_qe_start(struct usb_gadget *gadget, |