Commit 593195f9 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb

parents 983d5dbd f9cfc08d
...@@ -142,3 +142,4 @@ ...@@ -142,3 +142,4 @@
141 -> Asound Skyeye PCTV 141 -> Asound Skyeye PCTV
142 -> Sabrent TV-FM (bttv version) 142 -> Sabrent TV-FM (bttv version)
143 -> Hauppauge ImpactVCB (bt878) [0070:13eb] 143 -> Hauppauge ImpactVCB (bt878) [0070:13eb]
144 -> MagicTV
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001] 18 -> Hauppauge Nova-T DVB-T [0070:9002,0070:9001]
19 -> Conexant DVB-T reference design [14f1:0187] 19 -> Conexant DVB-T reference design [14f1:0187]
20 -> Provideo PV259 [1540:2580] 20 -> Provideo PV259 [1540:2580]
21 -> DViCO FusionHDTV DVB-T Plus [18ac:db10] 21 -> DViCO FusionHDTV DVB-T Plus [18ac:db10,18ac:db11]
22 -> pcHDTV HD3000 HDTV [7063:3000] 22 -> pcHDTV HD3000 HDTV [7063:3000]
23 -> digitalnow DNTV Live! DVB-T [17de:a8a6] 23 -> digitalnow DNTV Live! DVB-T [17de:a8a6]
24 -> Hauppauge WinTV 28xxx (Roslyn) models [0070:2801] 24 -> Hauppauge WinTV 28xxx (Roslyn) models [0070:2801]
......
...@@ -109,10 +109,9 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages) ...@@ -109,10 +109,9 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
struct page *pg; struct page *pg;
int i; int i;
sglist = kmalloc(sizeof(struct scatterlist)*nr_pages, GFP_KERNEL); sglist = kcalloc(nr_pages, sizeof(struct scatterlist), GFP_KERNEL);
if (NULL == sglist) if (NULL == sglist)
return NULL; return NULL;
memset(sglist,0,sizeof(struct scatterlist)*nr_pages);
for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) { for (i = 0; i < nr_pages; i++, virt += PAGE_SIZE) {
pg = vmalloc_to_page(virt); pg = vmalloc_to_page(virt);
if (NULL == pg) if (NULL == pg)
...@@ -306,15 +305,13 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent ...@@ -306,15 +305,13 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
struct saa7146_dev *dev; struct saa7146_dev *dev;
int err = -ENOMEM; int err = -ENOMEM;
dev = kmalloc(sizeof(struct saa7146_dev), GFP_KERNEL); /* clear out mem for sure */
dev = kzalloc(sizeof(struct saa7146_dev), GFP_KERNEL);
if (!dev) { if (!dev) {
ERR(("out of memory.\n")); ERR(("out of memory.\n"));
goto out; goto out;
} }
/* clear out mem for sure */
memset(dev, 0x0, sizeof(struct saa7146_dev));
DEB_EE(("pci:%p\n",pci)); DEB_EE(("pci:%p\n",pci));
err = pci_enable_device(pci); err = pci_enable_device(pci);
......
...@@ -239,13 +239,12 @@ static int fops_open(struct inode *inode, struct file *file) ...@@ -239,13 +239,12 @@ static int fops_open(struct inode *inode, struct file *file)
} }
/* allocate per open data */ /* allocate per open data */
fh = kmalloc(sizeof(*fh),GFP_KERNEL); fh = kzalloc(sizeof(*fh),GFP_KERNEL);
if (NULL == fh) { if (NULL == fh) {
DEB_S(("cannot allocate memory for per open data.\n")); DEB_S(("cannot allocate memory for per open data.\n"));
result = -ENOMEM; result = -ENOMEM;
goto out; goto out;
} }
memset(fh,0,sizeof(*fh));
file->private_data = fh; file->private_data = fh;
fh->dev = dev; fh->dev = dev;
...@@ -464,12 +463,11 @@ static struct video_device device_template = ...@@ -464,12 +463,11 @@ static struct video_device device_template =
int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv) int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
{ {
struct saa7146_vv *vv = kmalloc (sizeof(struct saa7146_vv),GFP_KERNEL); struct saa7146_vv *vv = kzalloc (sizeof(struct saa7146_vv),GFP_KERNEL);
if( NULL == vv ) { if( NULL == vv ) {
ERR(("out of memory. aborting.\n")); ERR(("out of memory. aborting.\n"));
return -1; return -1;
} }
memset(vv, 0x0, sizeof(*vv));
DEB_EE(("dev:%p\n",dev)); DEB_EE(("dev:%p\n",dev));
......
...@@ -220,20 +220,18 @@ EXPORT_SYMBOL(flexcop_reset_block_300); ...@@ -220,20 +220,18 @@ EXPORT_SYMBOL(flexcop_reset_block_300);
struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len) struct flexcop_device *flexcop_device_kmalloc(size_t bus_specific_len)
{ {
void *bus; void *bus;
struct flexcop_device *fc = kmalloc(sizeof(struct flexcop_device), GFP_KERNEL); struct flexcop_device *fc = kzalloc(sizeof(struct flexcop_device), GFP_KERNEL);
if (!fc) { if (!fc) {
err("no memory"); err("no memory");
return NULL; return NULL;
} }
memset(fc, 0, sizeof(struct flexcop_device));
bus = kmalloc(bus_specific_len, GFP_KERNEL); bus = kzalloc(bus_specific_len, GFP_KERNEL);
if (!bus) { if (!bus) {
err("no memory"); err("no memory");
kfree(fc); kfree(fc);
return NULL; return NULL;
} }
memset(bus, 0, bus_specific_len);
fc->bus_specific = bus; fc->bus_specific = bus;
......
...@@ -786,10 +786,9 @@ static int dvb_bt8xx_probe(struct device *dev) ...@@ -786,10 +786,9 @@ static int dvb_bt8xx_probe(struct device *dev)
struct pci_dev* bttv_pci_dev; struct pci_dev* bttv_pci_dev;
int ret; int ret;
if (!(card = kmalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL))) if (!(card = kzalloc(sizeof(struct dvb_bt8xx_card), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
memset(card, 0, sizeof(*card));
init_MUTEX(&card->lock); init_MUTEX(&card->lock);
card->bttv_nr = sub->core->nr; card->bttv_nr = sub->core->nr;
strncpy(card->card_name, sub->core->name, sizeof(sub->core->name)); strncpy(card->card_name, sub->core->name, sizeof(sub->core->name));
......
...@@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, ...@@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter,
return -EINVAL; return -EINVAL;
/* initialise the system data */ /* initialise the system data */
if ((ca = if ((ca = kzalloc(sizeof(struct dvb_ca_private), GFP_KERNEL)) == NULL) {
(struct dvb_ca_private *) kmalloc(sizeof(struct dvb_ca_private),
GFP_KERNEL)) == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto error; goto error;
} }
memset(ca, 0, sizeof(struct dvb_ca_private));
ca->pub = pubca; ca->pub = pubca;
ca->flags = flags; ca->flags = flags;
ca->slot_count = slot_count; ca->slot_count = slot_count;
if ((ca->slot_info = kmalloc(sizeof(struct dvb_ca_slot) * slot_count, GFP_KERNEL)) == NULL) { if ((ca->slot_info = kcalloc(slot_count, sizeof(struct dvb_ca_slot), GFP_KERNEL)) == NULL) {
ret = -ENOMEM; ret = -ENOMEM;
goto error; goto error;
} }
memset(ca->slot_info, 0, sizeof(struct dvb_ca_slot) * slot_count);
init_waitqueue_head(&ca->wait_queue); init_waitqueue_head(&ca->wait_queue);
ca->thread_pid = 0; ca->thread_pid = 0;
init_waitqueue_head(&ca->thread_queue); init_waitqueue_head(&ca->thread_queue);
......
...@@ -1024,13 +1024,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb, ...@@ -1024,13 +1024,12 @@ int dvb_register_frontend(struct dvb_adapter* dvb,
if (down_interruptible (&frontend_mutex)) if (down_interruptible (&frontend_mutex))
return -ERESTARTSYS; return -ERESTARTSYS;
fe->frontend_priv = kmalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL); fe->frontend_priv = kzalloc(sizeof(struct dvb_frontend_private), GFP_KERNEL);
if (fe->frontend_priv == NULL) { if (fe->frontend_priv == NULL) {
up(&frontend_mutex); up(&frontend_mutex);
return -ENOMEM; return -ENOMEM;
} }
fepriv = fe->frontend_priv; fepriv = fe->frontend_priv;
memset(fe->frontend_priv, 0, sizeof(struct dvb_frontend_private));
init_MUTEX (&fepriv->sem); init_MUTEX (&fepriv->sem);
init_waitqueue_head (&fepriv->wait_queue); init_waitqueue_head (&fepriv->wait_queue);
......
...@@ -253,6 +253,26 @@ static int cxusb_dee1601_demod_init(struct dvb_frontend* fe) ...@@ -253,6 +253,26 @@ static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
return 0; return 0;
} }
static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
{ /* used in both lgz201 and th7579 */
static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 };
static u8 reset [] = { RESET, 0x80 };
static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
mt352_write(fe, clock_config, sizeof(clock_config));
udelay(200);
mt352_write(fe, reset, sizeof(reset));
mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
mt352_write(fe, agc_cfg, sizeof(agc_cfg));
mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
return 0;
}
struct cx22702_config cxusb_cx22702_config = { struct cx22702_config cxusb_cx22702_config = {
.demod_address = 0x63, .demod_address = 0x63,
...@@ -274,6 +294,13 @@ struct mt352_config cxusb_dee1601_config = { ...@@ -274,6 +294,13 @@ struct mt352_config cxusb_dee1601_config = {
.pll_set = dvb_usb_pll_set, .pll_set = dvb_usb_pll_set,
}; };
struct mt352_config cxusb_mt352_config = {
/* used in both lgz201 and th7579 */
.demod_address = 0x0f,
.demod_init = cxusb_mt352_demod_init,
.pll_set = dvb_usb_pll_set,
};
/* Callbacks for DVB USB */ /* Callbacks for DVB USB */
static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d) static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_device *d)
{ {
...@@ -302,6 +329,20 @@ static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d) ...@@ -302,6 +329,20 @@ static int cxusb_dee1601_tuner_attach(struct dvb_usb_device *d)
return 0; return 0;
} }
static int cxusb_lgz201_tuner_attach(struct dvb_usb_device *d)
{
d->pll_addr = 0x61;
d->pll_desc = &dvb_pll_lg_z201;
return 0;
}
static int cxusb_dtt7579_tuner_attach(struct dvb_usb_device *d)
{
d->pll_addr = 0x60;
d->pll_desc = &dvb_pll_thomson_dtt7579;
return 0;
}
static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d)
{ {
u8 b; u8 b;
...@@ -329,6 +370,19 @@ static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) ...@@ -329,6 +370,19 @@ static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d)
return -EIO; return -EIO;
} }
static int cxusb_mt352_frontend_attach(struct dvb_usb_device *d)
{ /* used in both lgz201 and th7579 */
if (usb_set_interface(d->udev,0,0) < 0)
err("set interface failed");
cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0);
if ((d->fe = mt352_attach(&cxusb_mt352_config, &d->i2c_adap)) != NULL)
return 0;
return -EIO;
}
static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d) static int cxusb_dee1601_frontend_attach(struct dvb_usb_device *d)
{ {
if (usb_set_interface(d->udev,0,0) < 0) if (usb_set_interface(d->udev,0,0) < 0)
...@@ -370,13 +424,17 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const ...@@ -370,13 +424,17 @@ static int bluebird_patch_dvico_firmware_download(struct usb_device *udev, const
static struct dvb_usb_properties cxusb_medion_properties; static struct dvb_usb_properties cxusb_medion_properties;
static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties; static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties;
static struct dvb_usb_properties cxusb_bluebird_dee1601_properties; static struct dvb_usb_properties cxusb_bluebird_dee1601_properties;
static struct dvb_usb_properties cxusb_bluebird_lgz201_properties;
static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties;
static int cxusb_probe(struct usb_interface *intf, static int cxusb_probe(struct usb_interface *intf,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 || if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 || dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0) { dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0) {
return 0; return 0;
} }
...@@ -389,6 +447,12 @@ static struct usb_device_id cxusb_table [] = { ...@@ -389,6 +447,12 @@ static struct usb_device_id cxusb_table [] = {
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) }, { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) }, { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_COLD) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) }, { USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DEE1601_WARM) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD) },
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM) },
{} /* Terminating entry */ {} /* Terminating entry */
}; };
MODULE_DEVICE_TABLE (usb, cxusb_table); MODULE_DEVICE_TABLE (usb, cxusb_table);
...@@ -505,12 +569,96 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { ...@@ -505,12 +569,96 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = {
} }
}, },
.num_device_descs = 1, .num_device_descs = 2,
.devices = { .devices = {
{ "DViCO FusionHDTV DVB-T Dual USB", { "DViCO FusionHDTV DVB-T Dual USB",
{ &cxusb_table[3], NULL }, { &cxusb_table[3], NULL },
{ &cxusb_table[4], NULL }, { &cxusb_table[4], NULL },
}, },
{ "DigitalNow DVB-T Dual USB",
{ &cxusb_table[9], NULL },
{ &cxusb_table[10], NULL },
},
}
};
static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = {
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
.usb_ctrl = DEVICE_SPECIFIC,
.firmware = "dvb-usb-bluebird-01.fw",
.download_firmware = bluebird_patch_dvico_firmware_download,
/* use usb alt setting 0 for EP4 transfer (dvb-t),
use usb alt setting 7 for EP2 transfer (atsc) */
.size_of_priv = sizeof(struct cxusb_state),
.streaming_ctrl = cxusb_streaming_ctrl,
.power_ctrl = cxusb_power_ctrl,
.frontend_attach = cxusb_mt352_frontend_attach,
.tuner_attach = cxusb_lgz201_tuner_attach,
.i2c_algo = &cxusb_i2c_algo,
.generic_bulk_ctrl_endpoint = 0x01,
/* parameter for the MPEG2-data transfer */
.urb = {
.type = DVB_USB_BULK,
.count = 5,
.endpoint = 0x04,
.u = {
.bulk = {
.buffersize = 8192,
}
}
},
.num_device_descs = 1,
.devices = {
{ "DViCO FusionHDTV DVB-T USB (LGZ201)",
{ &cxusb_table[5], NULL },
{ &cxusb_table[6], NULL },
},
}
};
static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = {
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
.usb_ctrl = DEVICE_SPECIFIC,
.firmware = "dvb-usb-bluebird-01.fw",
.download_firmware = bluebird_patch_dvico_firmware_download,
/* use usb alt setting 0 for EP4 transfer (dvb-t),
use usb alt setting 7 for EP2 transfer (atsc) */
.size_of_priv = sizeof(struct cxusb_state),
.streaming_ctrl = cxusb_streaming_ctrl,
.power_ctrl = cxusb_power_ctrl,
.frontend_attach = cxusb_mt352_frontend_attach,
.tuner_attach = cxusb_dtt7579_tuner_attach,
.i2c_algo = &cxusb_i2c_algo,
.generic_bulk_ctrl_endpoint = 0x01,
/* parameter for the MPEG2-data transfer */
.urb = {
.type = DVB_USB_BULK,
.count = 5,
.endpoint = 0x04,
.u = {
.bulk = {
.buffersize = 8192,
}
}
},
.num_device_descs = 1,
.devices = {
{ "DViCO FusionHDTV DVB-T USB (TH7579)",
{ &cxusb_table[7], NULL },
{ &cxusb_table[8], NULL },
},
} }
}; };
......
...@@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d) ...@@ -156,10 +156,9 @@ struct dvb_frontend* dtt200u_fe_attach(struct dvb_usb_device *d)
struct dtt200u_fe_state* state = NULL; struct dtt200u_fe_state* state = NULL;
/* allocate memory for the internal state */ /* allocate memory for the internal state */
state = (struct dtt200u_fe_state*) kmalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL); state = kzalloc(sizeof(struct dtt200u_fe_state), GFP_KERNEL);
if (state == NULL) if (state == NULL)
goto error; goto error;
memset(state,0,sizeof(struct dtt200u_fe_state));
deb_info("attaching frontend dtt200u\n"); deb_info("attaching frontend dtt200u\n");
......
...@@ -95,6 +95,8 @@ ...@@ -95,6 +95,8 @@
#define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11 #define USB_PID_DVICO_BLUEBIRD_TH7579_WARM 0xdb11
#define USB_PID_DVICO_BLUEBIRD_DEE1601_COLD 0xdb50 #define USB_PID_DVICO_BLUEBIRD_DEE1601_COLD 0xdb50
#define USB_PID_DVICO_BLUEBIRD_DEE1601_WARM 0xdb51 #define USB_PID_DVICO_BLUEBIRD_DEE1601_WARM 0xdb51
#define USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_COLD 0xdb54
#define USB_PID_DIGITALNOW_BLUEBIRD_DEE1601_WARM 0xdb55
#define USB_PID_MEDION_MD95700 0x0932 #define USB_PID_MEDION_MD95700 0x0932
#define USB_PID_KYE_DVB_T_COLD 0x701e #define USB_PID_KYE_DVB_T_COLD 0x701e
#define USB_PID_KYE_DVB_T_WARM 0x701f #define USB_PID_KYE_DVB_T_WARM 0x701f
......
...@@ -154,12 +154,11 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties ...@@ -154,12 +154,11 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
} }
info("found a '%s' in warm state.",desc->name); info("found a '%s' in warm state.",desc->name);
d = kmalloc(sizeof(struct dvb_usb_device),GFP_KERNEL); d = kzalloc(sizeof(struct dvb_usb_device),GFP_KERNEL);
if (d == NULL) { if (d == NULL) {
err("no memory for 'struct dvb_usb_device'"); err("no memory for 'struct dvb_usb_device'");
return ret; return ret;
} }
memset(d,0,sizeof(struct dvb_usb_device));
d->udev = udev; d->udev = udev;
memcpy(&d->props,props,sizeof(struct dvb_usb_properties)); 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,13 +166,12 @@ int dvb_usb_device_init(struct usb_interface *intf, struct dvb_usb_properties
d->owner = owner; d->owner = owner;
if (d->props.size_of_priv > 0) { if (d->props.size_of_priv > 0) {
d->priv = kmalloc(d->props.size_of_priv,GFP_KERNEL); d->priv = kzalloc(d->props.size_of_priv,GFP_KERNEL);
if (d->priv == NULL) { if (d->priv == NULL) {
err("no memory for priv in 'struct dvb_usb_device'"); err("no memory for priv in 'struct dvb_usb_device'");
kfree(d); kfree(d);
return -ENOMEM; return -ENOMEM;
} }
memset(d->priv,0,d->props.size_of_priv);
} }
usb_set_intfdata(intf, d); usb_set_intfdata(intf, d);
......
...@@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un ...@@ -175,15 +175,13 @@ static int dvb_usb_allocate_stream_buffers(struct dvb_usb_device *d, int num, un
deb_mem("all in all I will use %lu bytes for streaming\n",num*size); deb_mem("all in all I will use %lu bytes for streaming\n",num*size);
if ((d->buf_list = kmalloc(num*sizeof(u8 *), GFP_ATOMIC)) == NULL) if ((d->buf_list = kcalloc(num, sizeof(u8 *), GFP_ATOMIC)) == NULL)
return -ENOMEM; return -ENOMEM;
if ((d->dma_addr = kmalloc(num*sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) { if ((d->dma_addr = kcalloc(num, sizeof(dma_addr_t), GFP_ATOMIC)) == NULL) {
kfree(d->buf_list); kfree(d->buf_list);
return -ENOMEM; return -ENOMEM;
} }
memset(d->buf_list,0,num*sizeof(u8 *));
memset(d->dma_addr,0,num*sizeof(dma_addr_t));
d->state |= DVB_USB_STATE_URB_BUF; d->state |= DVB_USB_STATE_URB_BUF;
...@@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d) ...@@ -285,10 +283,9 @@ int dvb_usb_urb_init(struct dvb_usb_device *d)
usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint)); usb_clear_halt(d->udev,usb_rcvbulkpipe(d->udev,d->props.urb.endpoint));
/* allocate the array for the data transfer URBs */ /* allocate the array for the data transfer URBs */
d->urb_list = kmalloc(d->props.urb.count * sizeof(struct urb *),GFP_KERNEL);