Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80b6ca48 authored by Eric Sesterhenn's avatar Eric Sesterhenn Committed by Greg Kroah-Hartman
Browse files

[PATCH] USB: kzalloc() conversion for rest of drivers/usb

parent d54a5cb6
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -220,12 +220,8 @@ static int ehci_mem_init (struct ehci_hcd *ehci, gfp_t flags)
		ehci->periodic [i] = EHCI_LIST_END;

	/* software shadow of hardware table */
	ehci->pshadow = kmalloc (ehci->periodic_size * sizeof (void *), flags);
	if (ehci->pshadow == NULL) {
		goto fail;
	}
	memset (ehci->pshadow, 0, ehci->periodic_size * sizeof (void *));

	ehci->pshadow = kcalloc(ehci->periodic_size, sizeof(void *), flags);
	if (ehci->pshadow != NULL)
		return 0;

fail:
+1 −2
Original line number Diff line number Diff line
@@ -864,9 +864,8 @@ iso_sched_alloc (unsigned packets, gfp_t mem_flags)
	int			size = sizeof *iso_sched;

	size += packets * sizeof (struct ehci_iso_packet);
	iso_sched = kmalloc (size, mem_flags);
	iso_sched = kzalloc(size, mem_flags);
	if (likely (iso_sched != NULL)) {
		memset(iso_sched, 0, size);
		INIT_LIST_HEAD (&iso_sched->td_list);
	}
	return iso_sched;
+4 −8
Original line number Diff line number Diff line
@@ -2137,10 +2137,9 @@ static int etrax_usb_submit_bulk_urb(struct urb *urb)
	urb->status = -EINPROGRESS;

	/* Setup the hcpriv data. */
	urb_priv = kmalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
	urb_priv = kzalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
	assert(urb_priv != NULL);
	/* This sets rx_offset to 0. */
	memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
	urb_priv->urb_state = NOT_STARTED;
	urb->hcpriv = urb_priv;

@@ -2475,10 +2474,9 @@ static int etrax_usb_submit_ctrl_urb(struct urb *urb)
	urb->status = -EINPROGRESS;

	/* Setup the hcpriv data. */
	urb_priv = kmalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
	urb_priv = kzalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
	assert(urb_priv != NULL);
	/* This sets rx_offset to 0. */
	memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
	urb_priv->urb_state = NOT_STARTED;
	urb->hcpriv = urb_priv;

@@ -2767,9 +2765,8 @@ static void etrax_usb_add_to_intr_sb_list(struct urb *urb, int epid)
	maxlen = usb_maxpacket(urb->dev, urb->pipe, usb_pipeout(urb->pipe));
	interval = urb->interval;

	urb_priv = kmalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
	urb_priv = kzalloc(sizeof(etrax_urb_priv_t), KMALLOC_FLAG);
	assert(urb_priv != NULL);
	memset(urb_priv, 0, sizeof(etrax_urb_priv_t));
	urb->hcpriv = urb_priv;

	first_ep = &TxIntrEPList[0];
@@ -2997,9 +2994,8 @@ static void etrax_usb_add_to_isoc_sb_list(struct urb *urb, int epid)

	prev_sb_desc = next_sb_desc = temp_sb_desc = NULL;

	urb_priv = kmalloc(sizeof(etrax_urb_priv_t), GFP_ATOMIC);
	urb_priv = kzalloc(sizeof(etrax_urb_priv_t), GFP_ATOMIC);
	assert(urb_priv != NULL);
	memset(urb_priv, 0, sizeof(etrax_urb_priv_t));

	urb->hcpriv = urb_priv;
	urb_priv->epid = epid;
+1 −3
Original line number Diff line number Diff line
@@ -5686,13 +5686,11 @@ ov51x_probe(struct usb_interface *intf, const struct usb_device_id *id)
	if (idesc->bInterfaceSubClass != 0x00)
		return -ENODEV;

	if ((ov = kmalloc(sizeof(*ov), GFP_KERNEL)) == NULL) {
	if ((ov = kzalloc(sizeof(*ov), GFP_KERNEL)) == NULL) {
		err("couldn't kmalloc ov struct");
		goto error_out;
	}

	memset(ov, 0, sizeof(*ov));

	ov->dev = dev;
	ov->iface = idesc->bInterfaceNumber;
	ov->led_policy = led;
+1 −2
Original line number Diff line number Diff line
@@ -1867,12 +1867,11 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id
		Info("Warning: more than 1 configuration available.\n");

	/* Allocate structure, initialize pointers, mutexes, etc. and link it to the usb_device */
	pdev = kmalloc(sizeof(struct pwc_device), GFP_KERNEL);
	pdev = kzalloc(sizeof(struct pwc_device), GFP_KERNEL);
	if (pdev == NULL) {
		Err("Oops, could not allocate memory for pwc_device.\n");
		return -ENOMEM;
	}
	memset(pdev, 0, sizeof(struct pwc_device));
	pdev->type = type_id;
	pdev->vsize = default_size;
	pdev->vframes = default_fps;
Loading