diff options
Diffstat (limited to 'drivers/media/dvb/dvb-core/dvb_ca_en50221.c')
-rw-r--r-- | drivers/media/dvb/dvb-core/dvb_ca_en50221.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c index 4bb779aeff6a..00347a750681 100644 --- a/drivers/media/dvb/dvb-core/dvb_ca_en50221.c +++ b/drivers/media/dvb/dvb-core/dvb_ca_en50221.c @@ -1649,21 +1649,17 @@ int dvb_ca_en50221_init(struct dvb_adapter *dvb_adapter, return -EINVAL; /* initialise the system data */ - if ((ca = - (struct dvb_ca_private *) kmalloc(sizeof(struct dvb_ca_private), - GFP_KERNEL)) == NULL) { + if ((ca = kzalloc(sizeof(struct dvb_ca_private), GFP_KERNEL)) == NULL) { ret = -ENOMEM; goto error; } - memset(ca, 0, sizeof(struct dvb_ca_private)); ca->pub = pubca; ca->flags = flags; 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; goto error; } - memset(ca->slot_info, 0, sizeof(struct dvb_ca_slot) * slot_count); init_waitqueue_head(&ca->wait_queue); ca->thread_pid = 0; init_waitqueue_head(&ca->thread_queue); |