diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-07-15 14:15:47 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-10-07 15:21:19 +0200 |
commit | 7984b3d299209fa7f67b85f80b853c9451030f7a (patch) | |
tree | f433a852915aa4cf6e4e8dda16f73384f48e1afe /drivers | |
parent | 58cffe3bca474afd4cbdb227d03b1bde79af8dc9 (diff) | |
download | linux-stable-7984b3d299209fa7f67b85f80b853c9451030f7a.tar.gz linux-stable-7984b3d299209fa7f67b85f80b853c9451030f7a.tar.bz2 linux-stable-7984b3d299209fa7f67b85f80b853c9451030f7a.zip |
usb: gadget: fsl_qe_udc: signedness bug in qe_get_frame()
commit f4693b08cc901912a87369c46537b94ed4084ea0 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-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) 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, |