Commit 8a511b12 authored by Dan Carpenter's avatar Dan Carpenter Committed by Jiri Slaby

usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()

commit f4693b08 upstream.

We can't assign -EINVAL to a u16.

Fixes: 3948f0e0 ('usb: add Freescale QE/CPM USB peripheral controller driver')
Acked-by: default avatarPeter Chen <peter.chen@nxp.com>
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent d723c203
...@@ -1881,11 +1881,8 @@ static int qe_get_frame(struct usb_gadget *gadget) ...@@ -1881,11 +1881,8 @@ static int qe_get_frame(struct usb_gadget *gadget)
tmp = in_be16(&udc->usb_param->frame_n); tmp = in_be16(&udc->usb_param->frame_n);
if (tmp & 0x8000) if (tmp & 0x8000)
tmp = tmp & 0x07ff; return tmp & 0x07ff;
else return -EINVAL;
tmp = -EINVAL;
return (int)tmp;
} }
static int fsl_qe_start(struct usb_gadget *gadget, static int fsl_qe_start(struct usb_gadget *gadget,
......
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