* [PATCH] media: cx24117: remove dead code in always 'false' if statement
@ 2013-11-19 13:49 Andi Shyti
2013-11-19 14:11 ` [PATCH] media: cx24117: use a valid dev pointer for dev_err printout Andi Shyti
0 siblings, 1 reply; 2+ messages in thread
From: Andi Shyti @ 2013-11-19 13:49 UTC (permalink / raw)
To: m.chehab, mkrufky, ljalvs, crope; +Cc: andi, linux-media, linux-kernel
At this point of the execution in the function cx24117_attach()
demod cannot be '0'. In that case the function returns earlier
with an error value ('NULL'). Remove the if statement.
This error has been reported by scan.coverity.com
Signed-off-by: Andi Shyti <andi@etezian.org>
---
drivers/media/dvb-frontends/cx24117.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c
index 476b422..07a9894 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -1190,12 +1190,6 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config,
state->demod = demod - 1;
state->priv = priv;
- /* test i2c bus for ack */
- if (demod == 0) {
- if (cx24117_readreg(state, 0x00) < 0)
- goto error3;
- }
-
dev_info(&state->priv->i2c->dev,
"%s: Attaching frontend %d\n",
KBUILD_MODNAME, state->demod);
@@ -1206,8 +1200,6 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config,
state->frontend.demodulator_priv = state;
return &state->frontend;
-error3:
- kfree(state);
error2:
cx24117_release_priv(priv);
error1:
--
1.8.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] media: cx24117: use a valid dev pointer for dev_err printout
2013-11-19 13:49 [PATCH] media: cx24117: remove dead code in always 'false' if statement Andi Shyti
@ 2013-11-19 14:11 ` Andi Shyti
0 siblings, 0 replies; 2+ messages in thread
From: Andi Shyti @ 2013-11-19 14:11 UTC (permalink / raw)
To: m.chehab, mkrufky, ljalvs, crope; +Cc: andi, linux-media, linux-kernel
Don't use '&state->priv->i2c->dev' reference to device because
state is still 'NULL'. Use '&i2c->dev' instead.
This bug has been reported by scan.coverity.com
Signed-off-by: Andi Shyti <andi@etezian.org>
---
Hi,
please apply this patch after my previous patch, forgot to
format them together.
Thanks,
Andi
---
drivers/media/dvb-frontends/cx24117.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/dvb-frontends/cx24117.c b/drivers/media/dvb-frontends/cx24117.c
index 07a9894..083830b 100644
--- a/drivers/media/dvb-frontends/cx24117.c
+++ b/drivers/media/dvb-frontends/cx24117.c
@@ -1166,7 +1166,7 @@ struct dvb_frontend *cx24117_attach(const struct cx24117_config *config,
switch (demod) {
case 0:
- dev_err(&state->priv->i2c->dev,
+ dev_err(&i2c->dev,
"%s: Error attaching frontend %d\n",
KBUILD_MODNAME, demod);
goto error1;
--
1.8.4.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-19 14:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-19 13:49 [PATCH] media: cx24117: remove dead code in always 'false' if statement Andi Shyti
2013-11-19 14:11 ` [PATCH] media: cx24117: use a valid dev pointer for dev_err printout Andi Shyti
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).