All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: David Rientjes <rientjes@cs.washington.edu>
Cc: linux-kernel@vger.kernel.org,
	Thomas Winischhofer <thomas@winischhofer.net>
Subject: Re: [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay()
Date: Mon, 23 Oct 2006 23:42:07 +0200	[thread overview]
Message-ID: <200610232342.07458.jesper.juhl@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64N.0610231425510.9588@attu2.cs.washington.edu>

On Monday 23 October 2006 23:26, David Rientjes wrote:
> On Mon, 23 Oct 2006, Jesper Juhl wrote:
> 
> > The variable 'j' is used uninitialized in the loop. Fix by initializing it to zero.
> > 
[snip]
> 
> I doubt this patch compile tested.
> 
You are right. I hang my head in shame and admit I did not compile test this one.
Fixed patch below.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 drivers/video/sis/init301.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/video/sis/init301.c b/drivers/video/sis/init301.c
index f13fadd..45a5969 100644
--- a/drivers/video/sis/init301.c
+++ b/drivers/video/sis/init301.c
@@ -445,7 +445,8 @@ #endif
 void
 SiS_DDC2Delay(struct SiS_Private *SiS_Pr, unsigned int delaytime)
 {
-   unsigned int i, j;
+   unsigned int i;
+   unsigned int j = 0;
 
    for(i = 0; i < delaytime; i++) {
       j += SiS_GetReg(SiS_Pr->SiS_P3c4,0x05);



  reply	other threads:[~2006-10-23 21:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-23 21:26 [PATCH] Fix use of uninitialized variable in drivers/video/sis/init301.c::SiS_DDC2Delay() Jesper Juhl
2006-10-23 21:26 ` David Rientjes
2006-10-23 21:42   ` Jesper Juhl [this message]
2006-10-23 22:09     ` Jesper Juhl

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=200610232342.07458.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rientjes@cs.washington.edu \
    --cc=thomas@winischhofer.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.