public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sigmund Augdal <sigmund@snap.tv>
To: linux-dvb@linuxtv.org
Cc: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Subject: [linux-dvb] [PATCH] Re:  Ooops in tda827x.c
Date: Wed, 04 Jun 2008 15:06:04 +0200	[thread overview]
Message-ID: <1212584764.32385.36.camel@pascal> (raw)
In-Reply-To: <1212535332.32385.29.camel@pascal>

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

Attached patch fixes the problem.

Best regards

Sigmund Augdal

On Wed, 2008-06-04 at 01:22 +0200, Sigmund Augdal wrote:
> changeset 49ba58715fe0 (7393) introduces an ooops in tda827x.c in
> tda827xa_lna_gain. The initialization of the "msg" variable accesses
> priv->cfg before the NULL check causing an oops when it is in fact
> NULL. 
> 
> Best regards
> 
> Sigmund Augdal
> 
> 
> _______________________________________________
> linux-dvb mailing list
> linux-dvb@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
> 

[-- Attachment #2: tda827x-oops.patch --]
[-- Type: text/x-patch, Size: 694 bytes --]

diff -r 6541620a09b7 linux/drivers/media/common/tuners/tda827x.c
--- a/linux/drivers/media/common/tuners/tda827x.c	Tue Jun 03 10:32:16 2008 -0300
+++ b/linux/drivers/media/common/tuners/tda827x.c	Wed Jun 04 15:03:15 2008 +0200
@@ -419,13 +419,14 @@
 	unsigned char buf[] = {0x22, 0x01};
 	int arg;
 	int gp_func;
-	struct i2c_msg msg = { .addr = priv->cfg->switch_addr, .flags = 0,
+	struct i2c_msg msg = { .flags = 0,
 			       .buf = buf, .len = sizeof(buf) };
 
 	if (NULL == priv->cfg) {
 		dprintk("tda827x_config not defined, cannot set LNA gain!\n");
 		return;
 	}
+	msg.addr = priv->cfg->switch_addr;
 	if (priv->cfg->config) {
 		if (high)
 			dprintk("setting LNA to high gain\n");

[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

  reply	other threads:[~2008-06-04 13:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-03 23:22 [linux-dvb] Ooops in tda827x.c Sigmund Augdal
2008-06-04 13:06 ` Sigmund Augdal [this message]
2008-06-04 13:39   ` [linux-dvb] [PATCH] " Michael Krufky
2008-06-04 13:45     ` Michael Krufky
2008-06-04 13:54       ` Sigmund Augdal
2008-06-04 14:03         ` Michael Krufky
2008-06-05  9:13           ` Sigmund Augdal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1212584764.32385.36.camel@pascal \
    --to=sigmund@snap.tv \
    --cc=hartmut.hackmann@t-online.de \
    --cc=linux-dvb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox