diff options
Diffstat (limited to 'drivers/net/wan/cosa.c')
-rw-r--r-- | drivers/net/wan/cosa.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c index 9ef49ce148b2..26058b4f8f36 100644 --- a/drivers/net/wan/cosa.c +++ b/drivers/net/wan/cosa.c | |||
@@ -572,13 +572,11 @@ static int cosa_probe(int base, int irq, int dma) | |||
572 | sprintf(cosa->name, "cosa%d", cosa->num); | 572 | sprintf(cosa->name, "cosa%d", cosa->num); |
573 | 573 | ||
574 | /* Initialize the per-channel data */ | 574 | /* Initialize the per-channel data */ |
575 | cosa->chan = kmalloc(sizeof(struct channel_data)*cosa->nchannels, | 575 | cosa->chan = kcalloc(cosa->nchannels, sizeof(struct channel_data), GFP_KERNEL); |
576 | GFP_KERNEL); | ||
577 | if (!cosa->chan) { | 576 | if (!cosa->chan) { |
578 | err = -ENOMEM; | 577 | err = -ENOMEM; |
579 | goto err_out3; | 578 | goto err_out3; |
580 | } | 579 | } |
581 | memset(cosa->chan, 0, sizeof(struct channel_data)*cosa->nchannels); | ||
582 | for (i=0; i<cosa->nchannels; i++) { | 580 | for (i=0; i<cosa->nchannels; i++) { |
583 | cosa->chan[i].cosa = cosa; | 581 | cosa->chan[i].cosa = cosa; |
584 | cosa->chan[i].num = i; | 582 | cosa->chan[i].num = i; |