staging: rtl8188eu: usb_dvobj_init(): A NULL pointer check for usb_host_endpoints makes no sense

struct usb_host_interface points to an array of
struct usb_host_endpoints - it makes no sense to do a NULL pointer
check for each pointer.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jes Sorensen 2014-12-01 15:20:58 -05:00 committed by Greg Kroah-Hartman
parent 8b21696c51
commit 6179ed592b
1 changed files with 13 additions and 16 deletions

View File

@ -63,7 +63,6 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
struct usb_config_descriptor *pconf_desc;
struct usb_host_interface *phost_iface;
struct usb_interface_descriptor *piface_desc;
struct usb_host_endpoint *phost_endp;
struct usb_endpoint_descriptor *pendp_desc;
struct usb_device *pusbd;
@ -92,24 +91,22 @@ static struct dvobj_priv *usb_dvobj_init(struct usb_interface *usb_intf)
for (i = 0; i < pdvobjpriv->nr_endpoint; i++) {
int ep_num;
phost_endp = phost_iface->endpoint + i;
pendp_desc = &phost_iface->endpoint[i].desc;
if (phost_endp) {
pendp_desc = &phost_endp->desc;
ep_num = usb_endpoint_num(pendp_desc);
ep_num = usb_endpoint_num(pendp_desc);
if (usb_endpoint_is_bulk_in(pendp_desc)) {
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
pdvobjpriv->RtNumInPipes++;
} else if (usb_endpoint_is_int_in(pendp_desc)) {
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
pdvobjpriv->RtNumInPipes++;
} else if (usb_endpoint_is_bulk_out(pendp_desc)) {
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] = ep_num;
pdvobjpriv->RtNumOutPipes++;
}
pdvobjpriv->ep_num[i] = ep_num;
if (usb_endpoint_is_bulk_in(pendp_desc)) {
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
pdvobjpriv->RtNumInPipes++;
} else if (usb_endpoint_is_int_in(pendp_desc)) {
pdvobjpriv->RtInPipe[pdvobjpriv->RtNumInPipes] = ep_num;
pdvobjpriv->RtNumInPipes++;
} else if (usb_endpoint_is_bulk_out(pendp_desc)) {
pdvobjpriv->RtOutPipe[pdvobjpriv->RtNumOutPipes] =
ep_num;
pdvobjpriv->RtNumOutPipes++;
}
pdvobjpriv->ep_num[i] = ep_num;
}
if (pusbd->speed == USB_SPEED_HIGH)