aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/hardware/avm/b1.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/hardware/avm/b1.c')
-rw-r--r--drivers/isdn/hardware/avm/b1.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/isdn/hardware/avm/b1.c b/drivers/isdn/hardware/avm/b1.c
index da2729247713..7a69a18d07e2 100644
--- a/drivers/isdn/hardware/avm/b1.c
+++ b/drivers/isdn/hardware/avm/b1.c
@@ -65,18 +65,15 @@ avmcard *b1_alloc_card(int nr_controllers)
65 avmctrl_info *cinfo; 65 avmctrl_info *cinfo;
66 int i; 66 int i;
67 67
68 card = kmalloc(sizeof(*card), GFP_KERNEL); 68 card = kzalloc(sizeof(*card), GFP_KERNEL);
69 if (!card) 69 if (!card)
70 return NULL; 70 return NULL;
71 71
72 memset(card, 0, sizeof(*card)); 72 cinfo = kzalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL);
73
74 cinfo = kmalloc(sizeof(*cinfo) * nr_controllers, GFP_KERNEL);
75 if (!cinfo) { 73 if (!cinfo) {
76 kfree(card); 74 kfree(card);
77 return NULL; 75 return NULL;
78 } 76 }
79 memset(cinfo, 0, sizeof(*cinfo) * nr_controllers);
80 77
81 card->ctrlinfo = cinfo; 78 card->ctrlinfo = cinfo;
82 for (i = 0; i < nr_controllers; i++) { 79 for (i = 0; i < nr_controllers; i++) {
@@ -718,12 +715,11 @@ avmcard_dma_alloc(char *name, struct pci_dev *pdev, long rsize, long ssize)
718 avmcard_dmainfo *p; 715 avmcard_dmainfo *p;
719 void *buf; 716 void *buf;
720 717
721 p = kmalloc(sizeof(avmcard_dmainfo), GFP_KERNEL); 718 p = kzalloc(sizeof(avmcard_dmainfo), GFP_KERNEL);
722 if (!p) { 719 if (!p) {
723 printk(KERN_WARNING "%s: no memory.\n", name); 720 printk(KERN_WARNING "%s: no memory.\n", name);
724 goto err; 721 goto err;
725 } 722 }
726 memset(p, 0, sizeof(avmcard_dmainfo));
727 723
728 p->recvbuf.size = rsize; 724 p->recvbuf.size = rsize;
729 buf = pci_alloc_consistent(pdev, rsize, &p->recvbuf.dmaaddr); 725 buf = pci_alloc_consistent(pdev, rsize, &p->recvbuf.dmaaddr);