summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-frontends/mb86a20s.c
diff options
context:
space:
mode:
authorMarkus Elfring2017-08-30 08:44:29 +0200
committerMauro Carvalho Chehab2017-09-23 14:23:59 +0200
commit9722e5696ca729044462c4456ddde90061809f7e (patch)
treed264555c230124952147ebe501e2dd2722ba7063 /drivers/media/dvb-frontends/mb86a20s.c
parentmedia: drivers: Adjust checks for null pointers (diff)
downloadkernel-qcow2-linux-9722e5696ca729044462c4456ddde90061809f7e.tar.gz
kernel-qcow2-linux-9722e5696ca729044462c4456ddde90061809f7e.tar.xz
kernel-qcow2-linux-9722e5696ca729044462c4456ddde90061809f7e.zip
media: dvb-frontends: delete jump targets
* Return directly after a call of the function "kzalloc" failed at the beginning. * Move a bit of exception handling code into an if branch. * Delete jump targets which became unnecessary with this refactoring. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hansverk@cisco.com>
Diffstat (limited to 'drivers/media/dvb-frontends/mb86a20s.c')
-rw-r--r--drivers/media/dvb-frontends/mb86a20s.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/media/dvb-frontends/mb86a20s.c b/drivers/media/dvb-frontends/mb86a20s.c
index ba7a433dd424..bdaf9d235fed 100644
--- a/drivers/media/dvb-frontends/mb86a20s.c
+++ b/drivers/media/dvb-frontends/mb86a20s.c
@@ -2073,7 +2073,7 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
/* allocate memory for the internal state */
state = kzalloc(sizeof(*state), GFP_KERNEL);
if (!state)
- goto error;
+ return NULL;
/* setup the state */
state->config = config;
@@ -2086,22 +2086,16 @@ struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
/* Check if it is a mb86a20s frontend */
rev = mb86a20s_readreg(state, 0);
-
- if (rev == 0x13) {
- dev_info(&i2c->dev,
- "Detected a Fujitsu mb86a20s frontend\n");
- } else {
+ if (rev != 0x13) {
+ kfree(state);
dev_dbg(&i2c->dev,
"Frontend revision %d is unknown - aborting.\n",
rev);
- goto error;
+ return NULL;
}
+ dev_info(&i2c->dev, "Detected a Fujitsu mb86a20s frontend\n");
return &state->frontend;
-
-error:
- kfree(state);
- return NULL;
}
EXPORT_SYMBOL(mb86a20s_attach);