summaryrefslogtreecommitdiff
path: root/drivers/usb/media
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-02-27 20:29:43 (GMT)
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-20 22:49:59 (GMT)
commit80b6ca48321974a6566a1c9048ba34f60420bca6 (patch)
treea350e3cf6b794081c13c89d5b1913b2c1207570d /drivers/usb/media
parentd54a5cb6484705f7808b337917cc7598f2f971c3 (diff)
downloadlinux-80b6ca48321974a6566a1c9048ba34f60420bca6.tar.xz
[PATCH] USB: kzalloc() conversion for rest of drivers/usb
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/media')
-rw-r--r--drivers/usb/media/ov511.c4
-rw-r--r--drivers/usb/media/pwc/pwc-if.c3
-rw-r--r--drivers/usb/media/se401.c4
-rw-r--r--drivers/usb/media/stv680.c7
4 files changed, 5 insertions, 13 deletions
diff --git a/drivers/usb/media/ov511.c b/drivers/usb/media/ov511.c
index 1d887ec..da44579 100644
--- a/drivers/usb/media/ov511.c
+++ b/drivers/usb/media/ov511.c
@@ -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;
diff --git a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c
index db6753d..90eb260 100644
--- a/drivers/usb/media/pwc/pwc-if.c
+++ b/drivers/usb/media/pwc/pwc-if.c
@@ -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;
diff --git a/drivers/usb/media/se401.c b/drivers/usb/media/se401.c
index 8c3b1ad..f03ea7f 100644
--- a/drivers/usb/media/se401.c
+++ b/drivers/usb/media/se401.c
@@ -1345,13 +1345,11 @@ static int se401_probe(struct usb_interface *intf,
/* We found one */
info("SE401 camera found: %s", camera_name);
- if ((se401 = kmalloc(sizeof(*se401), GFP_KERNEL)) == NULL) {
+ if ((se401 = kzalloc(sizeof(*se401), GFP_KERNEL)) == NULL) {
err("couldn't kmalloc se401 struct");
return -ENOMEM;
}
- memset(se401, 0, sizeof(*se401));
-
se401->dev = dev;
se401->iface = interface->bInterfaceNumber;
se401->camera_name = camera_name;
diff --git a/drivers/usb/media/stv680.c b/drivers/usb/media/stv680.c
index b1a6be2..9636da2 100644
--- a/drivers/usb/media/stv680.c
+++ b/drivers/usb/media/stv680.c
@@ -318,12 +318,11 @@ static int stv_init (struct usb_stv *stv680)
unsigned char *buffer;
unsigned long int bufsize;
- buffer = kmalloc (40, GFP_KERNEL);
+ buffer = kzalloc (40, GFP_KERNEL);
if (buffer == NULL) {
PDEBUG (0, "STV(e): Out of (small buf) memory");
return -1;
}
- memset (buffer, 0, 40);
udelay (100);
/* set config 1, interface 0, alternate 0 */
@@ -1388,14 +1387,12 @@ static int stv680_probe (struct usb_interface *intf, const struct usb_device_id
goto error;
}
/* We found one */
- if ((stv680 = kmalloc (sizeof (*stv680), GFP_KERNEL)) == NULL) {
+ if ((stv680 = kzalloc (sizeof (*stv680), GFP_KERNEL)) == NULL) {
PDEBUG (0, "STV(e): couldn't kmalloc stv680 struct.");
retval = -ENOMEM;
goto error;
}
- memset (stv680, 0, sizeof (*stv680));
-
stv680->udev = dev;
stv680->camera_name = camera_name;