aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/sc/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/sc/init.c')
-rw-r--r--drivers/isdn/sc/init.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c
index 06c9872e8c6a..150759a5cddf 100644
--- a/drivers/isdn/sc/init.c
+++ b/drivers/isdn/sc/init.c
@@ -271,14 +271,13 @@ static int __init sc_init(void)
271 * Horray! We found a board, Make sure we can register 271 * Horray! We found a board, Make sure we can register
272 * it with ISDN4Linux 272 * it with ISDN4Linux
273 */ 273 */
274 interface = kmalloc(sizeof(isdn_if), GFP_KERNEL); 274 interface = kzalloc(sizeof(isdn_if), GFP_KERNEL);
275 if (interface == NULL) { 275 if (interface == NULL) {
276 /* 276 /*
277 * Oops, can't malloc isdn_if 277 * Oops, can't malloc isdn_if
278 */ 278 */
279 continue; 279 continue;
280 } 280 }
281 memset(interface, 0, sizeof(isdn_if));
282 281
283 interface->owner = THIS_MODULE; 282 interface->owner = THIS_MODULE;
284 interface->hl_hdrlen = 0; 283 interface->hl_hdrlen = 0;
@@ -294,7 +293,7 @@ static int __init sc_init(void)
294 /* 293 /*
295 * Allocate the board structure 294 * Allocate the board structure
296 */ 295 */
297 sc_adapter[cinst] = kmalloc(sizeof(board), GFP_KERNEL); 296 sc_adapter[cinst] = kzalloc(sizeof(board), GFP_KERNEL);
298 if (sc_adapter[cinst] == NULL) { 297 if (sc_adapter[cinst] == NULL) {
299 /* 298 /*
300 * Oops, can't alloc memory for the board 299 * Oops, can't alloc memory for the board
@@ -302,7 +301,6 @@ static int __init sc_init(void)
302 kfree(interface); 301 kfree(interface);
303 continue; 302 continue;
304 } 303 }
305 memset(sc_adapter[cinst], 0, sizeof(board));
306 spin_lock_init(&sc_adapter[cinst]->lock); 304 spin_lock_init(&sc_adapter[cinst]->lock);
307 305
308 if(!register_isdn(interface)) { 306 if(!register_isdn(interface)) {
@@ -326,7 +324,7 @@ static int __init sc_init(void)
326 /* 324 /*
327 * Allocate channels status structures 325 * Allocate channels status structures
328 */ 326 */
329 sc_adapter[cinst]->channel = kmalloc(sizeof(bchan) * channels, GFP_KERNEL); 327 sc_adapter[cinst]->channel = kzalloc(sizeof(bchan) * channels, GFP_KERNEL);
330 if (sc_adapter[cinst]->channel == NULL) { 328 if (sc_adapter[cinst]->channel == NULL) {
331 /* 329 /*
332 * Oops, can't alloc memory for the channels 330 * Oops, can't alloc memory for the channels
@@ -336,7 +334,6 @@ static int __init sc_init(void)
336 kfree(sc_adapter[cinst]); 334 kfree(sc_adapter[cinst]);
337 continue; 335 continue;
338 } 336 }
339 memset(sc_adapter[cinst]->channel, 0, sizeof(bchan) * channels);
340 337
341 /* 338 /*
342 * Lock down the hardware resources 339 * Lock down the hardware resources