aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa5249.c
diff options
context:
space:
mode:
authorPanagiotis Issaris <takis@issaris.org>2006-01-11 16:40:56 -0500
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>2006-01-11 16:40:56 -0500
commit7408187d223f63d46a13b6a35b8f96b032c2f623 (patch)
tree425a459f760295de488f57e3f97b034aaa76a78d /drivers/media/video/saa5249.c
parent0b3af1b6df82cfdb54ae294ed860263011fa0408 (diff)
V4L/DVB (3344a): Conversions from kmalloc+memset to k(z|c)alloc
Conversions from kmalloc+memset to k(z|c)alloc. Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa5249.c')
-rw-r--r--drivers/media/video/saa5249.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/media/video/saa5249.c b/drivers/media/video/saa5249.c
index 73b4f0e2abf0..5694eb58c3a1 100644
--- a/drivers/media/video/saa5249.c
+++ b/drivers/media/video/saa5249.c
@@ -151,13 +151,12 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
151 client_template.adapter = adap; 151 client_template.adapter = adap;
152 client_template.addr = addr; 152 client_template.addr = addr;
153 memcpy(client, &client_template, sizeof(*client)); 153 memcpy(client, &client_template, sizeof(*client));
154 t = kmalloc(sizeof(*t), GFP_KERNEL); 154 t = kzalloc(sizeof(*t), GFP_KERNEL);
155 if(t==NULL) 155 if(t==NULL)
156 { 156 {
157 kfree(client); 157 kfree(client);
158 return -ENOMEM; 158 return -ENOMEM;
159 } 159 }
160 memset(t, 0, sizeof(*t));
161 strlcpy(client->name, IF_NAME, I2C_NAME_SIZE); 160 strlcpy(client->name, IF_NAME, I2C_NAME_SIZE);
162 init_MUTEX(&t->lock); 161 init_MUTEX(&t->lock);
163 162
@@ -165,7 +164,7 @@ static int saa5249_attach(struct i2c_adapter *adap, int addr, int kind)
165 * Now create a video4linux device 164 * Now create a video4linux device
166 */ 165 */
167 166
168 vd = (struct video_device *)kmalloc(sizeof(struct video_device), GFP_KERNEL); 167 vd = kmalloc(sizeof(struct video_device), GFP_KERNEL);
169 if(vd==NULL) 168 if(vd==NULL)
170 { 169 {
171 kfree(t); 170 kfree(t);