Loading drivers/net/usb/ax88172a.c +2 −4 Original line number Diff line number Diff line Loading @@ -117,7 +117,6 @@ static int ax88172a_init_mdio(struct usbnet *dev) priv->mdio->irq = kzalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); if (!priv->mdio->irq) { netdev_err(dev->net, "Could not allocate mdio->irq\n"); ret = -ENOMEM; goto mfree; } Loading Loading @@ -236,10 +235,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) usbnet_get_endpoints(dev, intf); priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) { netdev_err(dev->net, "Could not allocate memory for private data\n"); if (!priv) return -ENOMEM; } dev->driver_priv = priv; /* Get the MAC address */ Loading drivers/net/usb/hso.c +7 −18 Original line number Diff line number Diff line Loading @@ -2317,11 +2317,9 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, serial->rx_urb[i]->transfer_buffer_length = 0; serial->rx_data[i] = kzalloc(serial->rx_data_length, GFP_KERNEL); if (!serial->rx_data[i]) { dev_err(dev, "%s - Out of memory\n", __func__); if (!serial->rx_data[i]) goto exit; } } /* TX, allocate urb and initialize */ serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL); Loading @@ -2336,15 +2334,12 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, serial->tx_buffer_count = 0; serial->tx_data_length = tx_size; serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL); if (!serial->tx_data) { dev_err(dev, "%s - Out of memory\n", __func__); if (!serial->tx_data) goto exit; } serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL); if (!serial->tx_buffer) { dev_err(dev, "%s - Out of memory\n", __func__); if (!serial->tx_buffer) goto exit; } return 0; exit: Loading Loading @@ -2580,21 +2575,17 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, } hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE, GFP_KERNEL); if (!hso_net->mux_bulk_rx_buf_pool[i]) { dev_err(&interface->dev, "Could not allocate rx buf\n"); if (!hso_net->mux_bulk_rx_buf_pool[i]) goto exit; } } hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL); if (!hso_net->mux_bulk_tx_urb) { dev_err(&interface->dev, "Could not allocate tx urb\n"); goto exit; } hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL); if (!hso_net->mux_bulk_tx_buf) { dev_err(&interface->dev, "Could not allocate tx buf\n"); if (!hso_net->mux_bulk_tx_buf) goto exit; } add_net_device(hso_dev); Loading Loading @@ -2818,10 +2809,8 @@ struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) mux->shared_intr_buf = kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), GFP_KERNEL); if (!mux->shared_intr_buf) { dev_err(&interface->dev, "Could not allocate intr buf?\n"); if (!mux->shared_intr_buf) goto exit; } mutex_init(&mux->shared_int_lock); Loading drivers/net/usb/sierra_net.c +3 −7 Original line number Diff line number Diff line Loading @@ -459,11 +459,9 @@ static void sierra_net_kevent(struct work_struct *work) /* Query the modem for the LSI message */ buf = kzalloc(SIERRA_NET_USBCTL_BUF_LEN, GFP_KERNEL); if (!buf) { netdev_err(dev->net, "failed to allocate buf for LS msg\n"); if (!buf) return; } ifnum = priv->ifnum; len = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), USB_CDC_GET_ENCAPSULATED_RESPONSE, Loading Loading @@ -686,10 +684,8 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) } /* Initialize sierra private data */ priv = kzalloc(sizeof *priv, GFP_KERNEL); if (!priv) { dev_err(&dev->udev->dev, "No memory"); if (!priv) return -ENOMEM; } priv->usbnet = dev; priv->ifnum = ifacenum; Loading drivers/net/usb/smsc75xx.c +2 −4 Original line number Diff line number Diff line Loading @@ -1396,10 +1396,8 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) GFP_KERNEL); pdata = (struct smsc75xx_priv *)(dev->data[0]); if (!pdata) { netdev_warn(dev->net, "Unable to allocate smsc75xx_priv\n"); if (!pdata) return -ENOMEM; } pdata->dev = dev; Loading drivers/net/usb/smsc95xx.c +2 −4 Original line number Diff line number Diff line Loading @@ -1119,10 +1119,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) GFP_KERNEL); pdata = (struct smsc95xx_priv *)(dev->data[0]); if (!pdata) { netdev_warn(dev->net, "Unable to allocate struct smsc95xx_priv\n"); if (!pdata) return -ENOMEM; } spin_lock_init(&pdata->mac_cr_lock); Loading Loading
drivers/net/usb/ax88172a.c +2 −4 Original line number Diff line number Diff line Loading @@ -117,7 +117,6 @@ static int ax88172a_init_mdio(struct usbnet *dev) priv->mdio->irq = kzalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); if (!priv->mdio->irq) { netdev_err(dev->net, "Could not allocate mdio->irq\n"); ret = -ENOMEM; goto mfree; } Loading Loading @@ -236,10 +235,9 @@ static int ax88172a_bind(struct usbnet *dev, struct usb_interface *intf) usbnet_get_endpoints(dev, intf); priv = kzalloc(sizeof(*priv), GFP_KERNEL); if (!priv) { netdev_err(dev->net, "Could not allocate memory for private data\n"); if (!priv) return -ENOMEM; } dev->driver_priv = priv; /* Get the MAC address */ Loading
drivers/net/usb/hso.c +7 −18 Original line number Diff line number Diff line Loading @@ -2317,11 +2317,9 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, serial->rx_urb[i]->transfer_buffer_length = 0; serial->rx_data[i] = kzalloc(serial->rx_data_length, GFP_KERNEL); if (!serial->rx_data[i]) { dev_err(dev, "%s - Out of memory\n", __func__); if (!serial->rx_data[i]) goto exit; } } /* TX, allocate urb and initialize */ serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL); Loading @@ -2336,15 +2334,12 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, serial->tx_buffer_count = 0; serial->tx_data_length = tx_size; serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL); if (!serial->tx_data) { dev_err(dev, "%s - Out of memory\n", __func__); if (!serial->tx_data) goto exit; } serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL); if (!serial->tx_buffer) { dev_err(dev, "%s - Out of memory\n", __func__); if (!serial->tx_buffer) goto exit; } return 0; exit: Loading Loading @@ -2580,21 +2575,17 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, } hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE, GFP_KERNEL); if (!hso_net->mux_bulk_rx_buf_pool[i]) { dev_err(&interface->dev, "Could not allocate rx buf\n"); if (!hso_net->mux_bulk_rx_buf_pool[i]) goto exit; } } hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL); if (!hso_net->mux_bulk_tx_urb) { dev_err(&interface->dev, "Could not allocate tx urb\n"); goto exit; } hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL); if (!hso_net->mux_bulk_tx_buf) { dev_err(&interface->dev, "Could not allocate tx buf\n"); if (!hso_net->mux_bulk_tx_buf) goto exit; } add_net_device(hso_dev); Loading Loading @@ -2818,10 +2809,8 @@ struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) mux->shared_intr_buf = kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), GFP_KERNEL); if (!mux->shared_intr_buf) { dev_err(&interface->dev, "Could not allocate intr buf?\n"); if (!mux->shared_intr_buf) goto exit; } mutex_init(&mux->shared_int_lock); Loading
drivers/net/usb/sierra_net.c +3 −7 Original line number Diff line number Diff line Loading @@ -459,11 +459,9 @@ static void sierra_net_kevent(struct work_struct *work) /* Query the modem for the LSI message */ buf = kzalloc(SIERRA_NET_USBCTL_BUF_LEN, GFP_KERNEL); if (!buf) { netdev_err(dev->net, "failed to allocate buf for LS msg\n"); if (!buf) return; } ifnum = priv->ifnum; len = usb_control_msg(dev->udev, usb_rcvctrlpipe(dev->udev, 0), USB_CDC_GET_ENCAPSULATED_RESPONSE, Loading Loading @@ -686,10 +684,8 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) } /* Initialize sierra private data */ priv = kzalloc(sizeof *priv, GFP_KERNEL); if (!priv) { dev_err(&dev->udev->dev, "No memory"); if (!priv) return -ENOMEM; } priv->usbnet = dev; priv->ifnum = ifacenum; Loading
drivers/net/usb/smsc75xx.c +2 −4 Original line number Diff line number Diff line Loading @@ -1396,10 +1396,8 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) GFP_KERNEL); pdata = (struct smsc75xx_priv *)(dev->data[0]); if (!pdata) { netdev_warn(dev->net, "Unable to allocate smsc75xx_priv\n"); if (!pdata) return -ENOMEM; } pdata->dev = dev; Loading
drivers/net/usb/smsc95xx.c +2 −4 Original line number Diff line number Diff line Loading @@ -1119,10 +1119,8 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) GFP_KERNEL); pdata = (struct smsc95xx_priv *)(dev->data[0]); if (!pdata) { netdev_warn(dev->net, "Unable to allocate struct smsc95xx_priv\n"); if (!pdata) return -ENOMEM; } spin_lock_init(&pdata->mac_cr_lock); Loading