usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
Subsystems (3)
PATCH 1/1 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')
Signed-off-by Dan Carpenter <[email protected]>
drivers/usb/gadget/udc/fsl_qe_udc.c +2 -5
@@ -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,
Quoted 11 lines · Dan Carpenter
We can't assign
-EINVALto a u16.Fixes 3948f0e0c999 ('usb: add Freescale QE/CPM USB peripheral controller driver')Signed-off-by Dan Carpenter <[email protected]>drivers/usb/gadget/udc/fsl_qe_udc.c +0
-0@@ -1878,11 +1878,8 @@ static int qe_get_frame(struct usb_gadget *gadget)
drivers/usb/gadget/udc/fsl_qe_udc.c static int qe_get_frame(struct usb_gadget *gadget) · line 1883
Quoted 10 lines
drivers/usb/gadget/udc/fsl_qe_udc.c +2
-5tmp =in_be16 (&udc->usb_param->frame_n);if (tmp &0x8000 ) - tmp = tmp &0x07ff ; -else - tmp = -EINVAL ; - -return (int )tmp; +return tmp &0x07ff ; +return -EINVAL ; }
Acked-by Peter Chen <[email protected]>
Quoted 6 lines
drivers/usb/gadget/udc/fsl_qe_udc.c +0
-1static int fsl_qe_start(struct usb_gadget *gadget, --To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Best Regards, Peter Chen