aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb/dvb-usb-init.c
diff options
context:
space:
mode:
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);