aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/dmasound
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@mindspring.com>2007-02-14 03:33:16 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-14 11:09:54 -0500
commit3159f06dc2303630c02d1ad2eeaeaf341414c9df (patch)
tree678779f605dac635df3932381933b3950a0052ba /sound/oss/dmasound
parentcd354f1ae75e6466a7e31b727faede57a1f89ca5 (diff)
[PATCH] OSS: replace kmalloc()+memset() combos with kzalloc()
Replace kmalloc() + memset() pairs with the appropriate kzalloc() calls. Signed-off-by: Robert P. J. Day <rpjday@mindspring.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'sound/oss/dmasound')
-rw-r--r--sound/oss/dmasound/dac3550a.c3
-rw-r--r--sound/oss/dmasound/tas3001c.c3
-rw-r--r--sound/oss/dmasound/tas3004.c3
-rw-r--r--sound/oss/dmasound/tas_common.c3
4 files changed, 4 insertions, 8 deletions
diff --git a/sound/oss/dmasound/dac3550a.c b/sound/oss/dmasound/dac3550a.c
index 7360d8954d60..0f0d03a55dab 100644
--- a/sound/oss/dmasound/dac3550a.c
+++ b/sound/oss/dmasound/dac3550a.c
@@ -163,10 +163,9 @@ static int daca_detect_client(struct i2c_adapter *adapter, int address)
163 struct i2c_client *new_client; 163 struct i2c_client *new_client;
164 int rc = -ENODEV; 164 int rc = -ENODEV;
165 165
166 new_client = kmalloc(sizeof(*new_client), GFP_KERNEL); 166 new_client = kzalloc(sizeof(*new_client), GFP_KERNEL);
167 if (!new_client) 167 if (!new_client)
168 return -ENOMEM; 168 return -ENOMEM;
169 memset(new_client, 0, sizeof(*new_client));
170 169
171 new_client->addr = address; 170 new_client->addr = address;
172 new_client->adapter = adapter; 171 new_client->adapter = adapter;
diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
index 2f21a3c00374..4b7dbdd2a438 100644
--- a/sound/oss/dmasound/tas3001c.c
+++ b/sound/oss/dmasound/tas3001c.c
@@ -807,10 +807,9 @@ tas3001c_init(struct i2c_client *client)
807 size_t sz = sizeof(*self) + (TAS3001C_REG_MAX*sizeof(tas_shadow_t)); 807 size_t sz = sizeof(*self) + (TAS3001C_REG_MAX*sizeof(tas_shadow_t));
808 int i, j; 808 int i, j;
809 809
810 self = kmalloc(sz, GFP_KERNEL); 810 self = kzalloc(sz, GFP_KERNEL);
811 if (!self) 811 if (!self)
812 return -ENOMEM; 812 return -ENOMEM;
813 memset(self, 0, sz);
814 813
815 self->super.client = client; 814 self->super.client = client;
816 self->super.shadow = (tas_shadow_t *)(self+1); 815 self->super.shadow = (tas_shadow_t *)(self+1);
diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
index af34fb39bc29..678bf0ff6da2 100644
--- a/sound/oss/dmasound/tas3004.c
+++ b/sound/oss/dmasound/tas3004.c
@@ -1092,10 +1092,9 @@ tas3004_init(struct i2c_client *client)
1092 char mcr2 = 0; 1092 char mcr2 = 0;
1093 int i, j; 1093 int i, j;
1094 1094
1095 self = kmalloc(sz, GFP_KERNEL); 1095 self = kzalloc(sz, GFP_KERNEL);
1096 if (!self) 1096 if (!self)
1097 return -ENOMEM; 1097 return -ENOMEM;
1098 memset(self, 0, sz);
1099 1098
1100 self->super.client = client; 1099 self->super.client = client;
1101 self->super.shadow = (tas_shadow_t *)(self+1); 1100 self->super.shadow = (tas_shadow_t *)(self+1);
diff --git a/sound/oss/dmasound/tas_common.c b/sound/oss/dmasound/tas_common.c
index 882ae98a41b1..665e85b5562b 100644
--- a/sound/oss/dmasound/tas_common.c
+++ b/sound/oss/dmasound/tas_common.c
@@ -135,10 +135,9 @@ tas_detect_client(struct i2c_adapter *adapter, int address)
135 return -ENODEV; 135 return -ENODEV;
136 } 136 }
137 137
138 new_client = kmalloc(sizeof(*new_client), GFP_KERNEL); 138 new_client = kzalloc(sizeof(*new_client), GFP_KERNEL);
139 if (!new_client) 139 if (!new_client)
140 return -ENOMEM; 140 return -ENOMEM;
141 memset(new_client, 0, sizeof(*new_client));
142 141
143 new_client->addr = address; 142 new_client->addr = address;
144 new_client->adapter = adapter; 143 new_client->adapter = adapter;