aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa5249.c
diff options
context:
space:
mode:
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);