Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22031
b: refs/heads/master
c: 1759084
h: refs/heads/master
i:
  22029: 8bff6a9
  22027: 26531c4
  22023: 1c84ec5
  22015: 0b2d1d1
v: v3
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 71f56e4 commit e832aa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1144cf7af2ff8e6816e360d03f867439f7efde40
refs/heads/master: 17590840dc3c14cb059817466884ac9bd97c4a35
9 changes: 3 additions & 6 deletions trunk/drivers/usb/misc/phidgetkit.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,14 @@ static int change_outputs(struct phidget_interfacekit *kit, int output_num, int
int retval;
int n;

buffer = kmalloc(4, GFP_KERNEL);
buffer = kzalloc(4, GFP_KERNEL);
if (!buffer) {
dev_err(&kit->udev->dev, "%s - out of memory\n",
__FUNCTION__);
return -ENOMEM;
}

kit->outputs[output_num] = enable;
memset(buffer, 0, 4);
for (n=0; n<8; n++) {
if (kit->outputs[n]) {
buffer[0] |= 1 << n;
Expand Down Expand Up @@ -192,7 +191,7 @@ static ssize_t set_backlight(struct device *dev, struct device_attribute *attr,
unsigned char *buffer;
int retval = -ENOMEM;

buffer = kmalloc(8, GFP_KERNEL);
buffer = kzalloc(8, GFP_KERNEL);
if (!buffer) {
dev_err(&kit->udev->dev, "%s - out of memory\n", __FUNCTION__);
goto exit;
Expand All @@ -202,7 +201,6 @@ static ssize_t set_backlight(struct device *dev, struct device_attribute *attr,
retval = -EINVAL;
goto exit;
}
memset(buffer, 0x00, 8);
if (enabled)
buffer[0] = 0x01;
buffer[7] = 0x11;
Expand Down Expand Up @@ -406,12 +404,11 @@ static int interfacekit_probe(struct usb_interface *intf, const struct usb_devic
pipe = usb_rcvintpipe(dev, endpoint->bEndpointAddress);
maxp = usb_maxpacket(dev, pipe, usb_pipeout(pipe));

kit = kmalloc(sizeof(*kit), GFP_KERNEL);
kit = kzalloc(sizeof(*kit), GFP_KERNEL);
if (kit == NULL) {
dev_err(&intf->dev, "%s - out of memory\n", __FUNCTION__);
return -ENOMEM;
}
memset(kit, 0, sizeof(*kit));
kit->ifkit = ifkit;

kit->data = usb_buffer_alloc(dev, 8, SLAB_ATOMIC, &kit->data_dma);
Expand Down

0 comments on commit e832aa0

Please sign in to comment.