diff options
author | Dan Carpenter <error27@gmail.com> | 2010-05-05 01:58:18 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:59:12 -0400 |
commit | 83b6601c880d1b908b07952e9a5fdbe5f5c76c96 (patch) | |
tree | 80201751f647f21651553de310ddd295b0202941 /drivers/media | |
parent | 1a2f7178cbfeea7045b6cd226319d528f60891b8 (diff) |
V4L/DVB: dvb/stv6110x: cleanup error handling
The "stv6110x" is NULL so we can just return directly without calling
kfree(). Also I changed the printk() to make checkpatch.pl happy.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/stv6110x.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/media/dvb/frontends/stv6110x.c b/drivers/media/dvb/frontends/stv6110x.c index 2f9cd2441340..42591ce1aaad 100644 --- a/drivers/media/dvb/frontends/stv6110x.c +++ b/drivers/media/dvb/frontends/stv6110x.c | |||
@@ -363,8 +363,8 @@ struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe, | |||
363 | u8 default_regs[] = {0x07, 0x11, 0xdc, 0x85, 0x17, 0x01, 0xe6, 0x1e}; | 363 | u8 default_regs[] = {0x07, 0x11, 0xdc, 0x85, 0x17, 0x01, 0xe6, 0x1e}; |
364 | 364 | ||
365 | stv6110x = kzalloc(sizeof (struct stv6110x_state), GFP_KERNEL); | 365 | stv6110x = kzalloc(sizeof (struct stv6110x_state), GFP_KERNEL); |
366 | if (stv6110x == NULL) | 366 | if (!stv6110x) |
367 | goto error; | 367 | return NULL; |
368 | 368 | ||
369 | stv6110x->i2c = i2c; | 369 | stv6110x->i2c = i2c; |
370 | stv6110x->config = config; | 370 | stv6110x->config = config; |
@@ -392,12 +392,8 @@ struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe, | |||
392 | fe->tuner_priv = stv6110x; | 392 | fe->tuner_priv = stv6110x; |
393 | fe->ops.tuner_ops = stv6110x_ops; | 393 | fe->ops.tuner_ops = stv6110x_ops; |
394 | 394 | ||
395 | printk("%s: Attaching STV6110x \n", __func__); | 395 | printk(KERN_INFO "%s: Attaching STV6110x\n", __func__); |
396 | return stv6110x->devctl; | 396 | return stv6110x->devctl; |
397 | |||
398 | error: | ||
399 | kfree(stv6110x); | ||
400 | return NULL; | ||
401 | } | 397 | } |
402 | EXPORT_SYMBOL(stv6110x_attach); | 398 | EXPORT_SYMBOL(stv6110x_attach); |
403 | 399 | ||