V4L/DVB: dvb/stv6110x: cleanup error handling
authorDan Carpenter <error27@gmail.com>
Wed, 5 May 2010 05:58:18 +0000 (02:58 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 19 May 2010 15:59:12 +0000 (12:59 -0300)
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>
drivers/media/dvb/frontends/stv6110x.c

index 2f9cd2441340360fd86dc6ef064dda6183f9d51a..42591ce1aaaddbd62c104a9ab47d807a3239e882 100644 (file)
@@ -363,8 +363,8 @@ struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
        u8 default_regs[] = {0x07, 0x11, 0xdc, 0x85, 0x17, 0x01, 0xe6, 0x1e};
 
        stv6110x = kzalloc(sizeof (struct stv6110x_state), GFP_KERNEL);
-       if (stv6110x == NULL)
-               goto error;
+       if (!stv6110x)
+               return NULL;
 
        stv6110x->i2c           = i2c;
        stv6110x->config        = config;
@@ -392,12 +392,8 @@ struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
        fe->tuner_priv          = stv6110x;
        fe->ops.tuner_ops       = stv6110x_ops;
 
-       printk("%s: Attaching STV6110x \n", __func__);
+       printk(KERN_INFO "%s: Attaching STV6110x\n", __func__);
        return stv6110x->devctl;
-
-error:
-       kfree(stv6110x);
-       return NULL;
 }
 EXPORT_SYMBOL(stv6110x_attach);