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

Commit 089b1dbb authored by Deepak Saxena's avatar Deepak Saxena Committed by Linus Torvalds
Browse files

[PATCH] bluetooth: kmalloc + memset -> kzalloc conversion



Signed-off-by: default avatarDeepak Saxena <dsaxena@plexity.net>
Cc: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f5e3c2fa
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -179,14 +179,12 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
	if (ignore || (intf->cur_altsetting->desc.bInterfaceNumber != 0))
		return -ENODEV;

	data = kmalloc(sizeof(*data), GFP_KERNEL);
	data = kzalloc(sizeof(*data), GFP_KERNEL);
	if (!data) {
		BT_ERR("Can't allocate memory for data structure");
		return -ENOMEM;
	}

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

	data->udev  = udev;
	data->state = BCM203X_LOAD_MINIDRV;

+1 −3
Original line number Diff line number Diff line
@@ -673,13 +673,11 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
	}

	/* Initialize control structure and load firmware */
	if (!(bfusb = kmalloc(sizeof(struct bfusb), GFP_KERNEL))) {
	if (!(bfusb = kzalloc(sizeof(struct bfusb), GFP_KERNEL))) {
		BT_ERR("Can't allocate memory for control structure");
		goto done;
	}

	memset(bfusb, 0, sizeof(struct bfusb));

	bfusb->udev = udev;
	bfusb->bulk_in_ep    = bulk_in_ep->desc.bEndpointAddress;
	bfusb->bulk_out_ep   = bulk_out_ep->desc.bEndpointAddress;
+1 −2
Original line number Diff line number Diff line
@@ -870,10 +870,9 @@ static dev_link_t *bluecard_attach(void)
	int ret;

	/* Create new info device */
	info = kmalloc(sizeof(*info), GFP_KERNEL);
	info = kzalloc(sizeof(*info), GFP_KERNEL);
	if (!info)
		return NULL;
	memset(info, 0, sizeof(*info));

	link = &info->link;
	link->priv = info;
+1 −3
Original line number Diff line number Diff line
@@ -553,14 +553,12 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
	if (intf->cur_altsetting->desc.bInterfaceNumber > 0)
		return -ENODEV;

	data = kmalloc(sizeof(*data), GFP_KERNEL);
	data = kzalloc(sizeof(*data), GFP_KERNEL);
	if (!data) {
		BT_ERR("Can't allocate data structure");
		return -ENOMEM;
	}

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

	data->udev = udev;

	rwlock_init(&data->lock);
+1 −2
Original line number Diff line number Diff line
@@ -671,10 +671,9 @@ static dev_link_t *bt3c_attach(void)
	int ret;

	/* Create new info device */
	info = kmalloc(sizeof(*info), GFP_KERNEL);
	info = kzalloc(sizeof(*info), GFP_KERNEL);
	if (!info)
		return NULL;
	memset(info, 0, sizeof(*info));

	link = &info->link;
	link->priv = info;
Loading