aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dvb-usb-init.c
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis@issaris.org>2006-01-11 16:40:56 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-11 16:40:56 -0500
commit7408187d223f63d46a13b6a35b8f96b032c2f623 (patch)
tree425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/dvb/dvb-usb/dvb-usb-init.c
parent0b3af1b6df82cfdb54ae294ed860263011fa0408 (diff)
V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc
Conversions from kmalloc+memset to k(z|c)alloc. Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/dvb-usb-init.c')
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
index 2e23060cbbca..716f8bf528cd 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c
@@ -154,12 +154,11 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
154 } 154 }
155 155
156 info("found a '%s' in warm state.",desc->name); 156 info("found a '%s' in warm state.",desc->name);
157 d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); 157 d = kzalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
158 if (d == NULL) { 158 if (d == NULL) {
159 err("no memory for 'struct dvb_usb_device'"); 159 err("no memory for 'struct dvb_usb_device'");
160 return ret; 160 return ret;
161 } 161 }
162 memset(d,0,sizeof(struct dvb_usb_device));
163 162
164 d->udev = udev; 163 d->udev = udev;
165 memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); 164 memcpy(&d->props,props,sizeof(struct dvb_usb_properties));
@@ -167,13 +166,12 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
167 d->owner = owner; 166 d->owner = owner;
168 167
169 if (d->props.size_of_priv > 0) { 168 if (d->props.size_of_priv > 0) {
170 d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); 169 d->priv = kzalloc(d->props.size_of_priv,GFP_KERNEL);
171 if (d->priv == NULL) { 170 if (d->priv == NULL) {
172 err("no memory for priv in 'struct dvb_usb_device'"); 171 err("no memory for priv in 'struct dvb_usb_device'");
173 kfree(d); 172 kfree(d);
174 return -ENOMEM; 173 return -ENOMEM;
175 } 174 }
176 memset(d->priv,0,d->props.size_of_priv);
177 } 175 }
178 176
179 usb_set_intfdata(intf, d); 177 usb_set_intfdata(intf, d);