[PATCH 3/3] [media] si2168: One function call less in si2168_init() after error detection

From: SF Markus Elfring
Date: Thu Nov 20 2014 - 03:40:04 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 19 Nov 2014 23:23:15 +0100

The release_firmware() function was called in some cases by the
si2168_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: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/media/dvb-frontends/si2168.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/media/dvb-frontends/si2168.c b/drivers/media/dvb-frontends/si2168.c
index 6a455f9..b8c6372 100644
--- a/drivers/media/dvb-frontends/si2168.c
+++ b/drivers/media/dvb-frontends/si2168.c
@@ -428,7 +428,7 @@ static int si2168_init(struct dvb_frontend *fe)
dev_err(&s->client->dev,
"%s: firmware file '%s' not found\n",
KBUILD_MODNAME, fw_file);
- goto err;
+ goto error_fw_release;
}
}

@@ -448,7 +448,7 @@ static int si2168_init(struct dvb_frontend *fe)
dev_err(&s->client->dev,
"%s: firmware download failed=%d\n",
KBUILD_MODNAME, ret);
- goto err;
+ goto error_fw_release;
}
}

@@ -468,9 +468,10 @@ static int si2168_init(struct dvb_frontend *fe)
s->active = true;

return 0;
-err:
- release_firmware(fw);

+error_fw_release:
+ release_firmware(fw);
+err:
dev_dbg(&s->client->dev, "%s: failed=%d\n", __func__, ret);
return ret;
}
--
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/