aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/dvb-usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/dvb-usb')
-rw-r--r--drivers/media/dvb/dvb-usb/dtt200u-fe.c3
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-init.c6
-rw-r--r--drivers/media/dvb/dvb-usb/dvb-usb-urb.c9
-rw-r--r--drivers/media/dvb/dvb-usb/vp702x-fe.c3
-rw-r--r--drivers/media/dvb/dvb-usb/vp7045-fe.c3
5 files changed, 8 insertions, 16 deletions
diff --git a/drivers/media/dvb/dvb-usb/dtt200u-fe.c b/drivers/media/dvb/dvb-usb/dtt200u-fe.c
index 0a94ec22aeb8..cd21ddbfd054 100644
--- a/drivers/media/dvb/dvb-usb/dtt200u-fe.c
+++ b/drivers/media/dvb/dvb-usb/dtt200u-fe.c
@@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
156 struct dtt200u_fe_state* state = NULL; 156 struct dtt200u_fe_state* state = NULL;
157 157
158 /* allocate memory for the internal state */ 158 /* allocate memory for the internal state */
159 state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); 159 state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
160 if (state == NULL) 160 if (state == NULL)
161 goto error; 161 goto error;
162 memset(state,0,sizeof(struct dtt200u_fe_state));
163 162
164 deb_info("attaching frontend dtt200u\n"); 163 deb_info("attaching frontend dtt200u\n");
165 164
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);
diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
index 36b7048c02d2..ee821974dc60 100644
--- a/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
+++ b/drivers/media/dvb/dvb-usb/dvb-usb-urb.c
@@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un
175 175
176 deb_mem("all in all I will use %lu bytes for streaming\n",num*size); 176 deb_mem("all in all I will use %lu bytes for streaming\n",num*size);
177 177
178 if ((d->buf_list = kmalloc(num*sizeof(u8 *), GFP_ATOMIC)) == NULL) 178 if ((d->buf_list = kcalloc(num, sizeof(u8 *), GFP_ATOMIC)) == NULL)
179 return -ENOMEM; 179 return -ENOMEM;
180 180
181 if ((d->dma_addr = kmalloc(num*sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) { 181 if ((d->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
182 kfree(d->buf_list); 182 kfree(d->buf_list);
183 return -ENOMEM; 183 return -ENOMEM;
184 } 184 }
185 memset(d->buf_list,0,num*sizeof(u8 *));
186 memset(d->dma_addr,0,num*sizeof(dma_addr_t));
187 185
188 d->state |= DVB_USB_STATE_URB_BUF; 186 d->state |= DVB_USB_STATE_URB_BUF;
189 187
@@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d)
285 usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint)); 283 usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint));
286 284
287 /* allocate the array for the data transfer URBs */ 285 /* allocate the array for the data transfer URBs */
288 d->urb_list = kmalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL); 286 d->urb_list = kzalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);
289 if (d->urb_list == NULL) 287 if (d->urb_list == NULL)
290 return -ENOMEM; 288 return -ENOMEM;
291 memset(d->urb_list,0,d->props.urb.count * sizeof(struct urb *));
292 d->state |= DVB_USB_STATE_URB_LIST; 289 d->state |= DVB_USB_STATE_URB_LIST;
293 290
294 switch (d->props.urb.type) { 291 switch (d->props.urb.type) {
diff --git a/drivers/media/dvb/dvb-usb/vp702x-fe.c b/drivers/media/dvb/dvb-usb/vp702x-fe.c
index 0885d9fb2bf2..b6d95e1c9c52 100644
--- a/drivers/media/dvb/dvb-usb/vp702x-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp702x-fe.c
@@ -281,10 +281,9 @@ static struct dvb_frontend_ops vp702x_fe_ops;
281 281
282struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d) 282struct dvb_frontend * vp702x_fe_attach(struct dvb_usb_device *d)
283{ 283{
284 struct vp702x_fe_state *s = kmalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL); 284 struct vp702x_fe_state *s = kzalloc(sizeof(struct vp702x_fe_state), GFP_KERNEL);
285 if (s == NULL) 285 if (s == NULL)
286 goto error; 286 goto error;
287 memset(s,0,sizeof(struct vp702x_fe_state));
288 287
289 s->d = d; 288 s->d = d;
290 s->fe.ops = &vp702x_fe_ops; 289 s->fe.ops = &vp702x_fe_ops;
diff --git a/drivers/media/dvb/dvb-usb/vp7045-fe.c b/drivers/media/dvb/dvb-usb/vp7045-fe.c
index 83f1de1e7e57..5242cca5db4a 100644
--- a/drivers/media/dvb/dvb-usb/vp7045-fe.c
+++ b/drivers/media/dvb/dvb-usb/vp7045-fe.c
@@ -145,10 +145,9 @@ static struct dvb_frontend_ops vp7045_fe_ops;
145 145
146struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d) 146struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d)
147{ 147{
148 struct vp7045_fe_state *s = kmalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL); 148 struct vp7045_fe_state *s = kzalloc(sizeof(struct vp7045_fe_state), GFP_KERNEL);
149 if (s == NULL) 149 if (s == NULL)
150 goto error; 150 goto error;
151 memset(s,0,sizeof(struct vp7045_fe_state));
152 151
153 s->d = d; 152 s->d = d;
154 s->fe.ops = &vp7045_fe_ops; 153 s->fe.ops = &vp7045_fe_ops;