diff options
Diffstat (limited to 'drivers/char/snsc.c')
-rw-r--r-- | drivers/char/snsc.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c index 0e7d216e7eb0..b543821d8cb4 100644 --- a/drivers/char/snsc.c +++ b/drivers/char/snsc.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * License. See the file "COPYING" in the main directory of this archive | 5 | * License. See the file "COPYING" in the main directory of this archive |
6 | * for more details. | 6 | * for more details. |
7 | * | 7 | * |
8 | * Copyright (C) 2004 Silicon Graphics, Inc. All rights reserved. | 8 | * Copyright (C) 2004, 2006 Silicon Graphics, Inc. All rights reserved. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | /* | 11 | /* |
@@ -77,7 +77,7 @@ scdrv_open(struct inode *inode, struct file *file) | |||
77 | scd = container_of(inode->i_cdev, struct sysctl_data_s, scd_cdev); | 77 | scd = container_of(inode->i_cdev, struct sysctl_data_s, scd_cdev); |
78 | 78 | ||
79 | /* allocate memory for subchannel data */ | 79 | /* allocate memory for subchannel data */ |
80 | sd = kmalloc(sizeof (struct subch_data_s), GFP_KERNEL); | 80 | sd = kzalloc(sizeof (struct subch_data_s), GFP_KERNEL); |
81 | if (sd == NULL) { | 81 | if (sd == NULL) { |
82 | printk("%s: couldn't allocate subchannel data\n", | 82 | printk("%s: couldn't allocate subchannel data\n", |
83 | __FUNCTION__); | 83 | __FUNCTION__); |
@@ -85,7 +85,6 @@ scdrv_open(struct inode *inode, struct file *file) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | /* initialize subch_data_s fields */ | 87 | /* initialize subch_data_s fields */ |
88 | memset(sd, 0, sizeof (struct subch_data_s)); | ||
89 | sd->sd_nasid = scd->scd_nasid; | 88 | sd->sd_nasid = scd->scd_nasid; |
90 | sd->sd_subch = ia64_sn_irtr_open(scd->scd_nasid); | 89 | sd->sd_subch = ia64_sn_irtr_open(scd->scd_nasid); |
91 | 90 | ||
@@ -394,7 +393,7 @@ scdrv_init(void) | |||
394 | sprintf(devnamep, "#%d", geo_slab(geoid)); | 393 | sprintf(devnamep, "#%d", geo_slab(geoid)); |
395 | 394 | ||
396 | /* allocate sysctl device data */ | 395 | /* allocate sysctl device data */ |
397 | scd = kmalloc(sizeof (struct sysctl_data_s), | 396 | scd = kzalloc(sizeof (struct sysctl_data_s), |
398 | GFP_KERNEL); | 397 | GFP_KERNEL); |
399 | if (!scd) { | 398 | if (!scd) { |
400 | printk("%s: failed to allocate device info" | 399 | printk("%s: failed to allocate device info" |
@@ -402,7 +401,6 @@ scdrv_init(void) | |||
402 | SYSCTL_BASENAME, devname); | 401 | SYSCTL_BASENAME, devname); |
403 | continue; | 402 | continue; |
404 | } | 403 | } |
405 | memset(scd, 0, sizeof (struct sysctl_data_s)); | ||
406 | 404 | ||
407 | /* initialize sysctl device data fields */ | 405 | /* initialize sysctl device data fields */ |
408 | scd->scd_nasid = cnodeid_to_nasid(cnode); | 406 | scd->scd_nasid = cnodeid_to_nasid(cnode); |