Commit 5ed0cf88 authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

[media] m88ds3103: One function call less in m88ds3103_init() after error detection

GIT_AUTHOR_DATE=1416472158
The release_firmware() function was called in some cases by the
m88ds3103_init() function during error handling even if the passed variable
contained still a null pointer. This implementation detail could be improved
by the introduction of another jump label.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 9bc2dd7e
...@@ -640,7 +640,7 @@ static int m88ds3103_init(struct dvb_frontend *fe) ...@@ -640,7 +640,7 @@ static int m88ds3103_init(struct dvb_frontend *fe)
ret = m88ds3103_wr_reg(priv, 0xb2, 0x01); ret = m88ds3103_wr_reg(priv, 0xb2, 0x01);
if (ret) if (ret)
goto err; goto error_fw_release;
for (remaining = fw->size; remaining > 0; for (remaining = fw->size; remaining > 0;
remaining -= (priv->cfg->i2c_wr_max - 1)) { remaining -= (priv->cfg->i2c_wr_max - 1)) {
...@@ -654,13 +654,13 @@ static int m88ds3103_init(struct dvb_frontend *fe) ...@@ -654,13 +654,13 @@ static int m88ds3103_init(struct dvb_frontend *fe)
dev_err(&priv->i2c->dev, dev_err(&priv->i2c->dev,
"%s: firmware download failed=%d\n", "%s: firmware download failed=%d\n",
KBUILD_MODNAME, ret); KBUILD_MODNAME, ret);
goto err; goto error_fw_release;
} }
} }
ret = m88ds3103_wr_reg(priv, 0xb2, 0x00); ret = m88ds3103_wr_reg(priv, 0xb2, 0x00);
if (ret) if (ret)
goto err; goto error_fw_release;
release_firmware(fw); release_firmware(fw);
fw = NULL; fw = NULL;
...@@ -686,9 +686,10 @@ static int m88ds3103_init(struct dvb_frontend *fe) ...@@ -686,9 +686,10 @@ static int m88ds3103_init(struct dvb_frontend *fe)
priv->warm = true; priv->warm = true;
return 0; return 0;
err:
release_firmware(fw);
error_fw_release:
release_firmware(fw);
err:
dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret); dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment