linux-mips
[Top] [All Lists]

Re: [PATCH v2] MIPS: ath79: Avoid using unitialized 'reg' variable

To: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>, David Howells <dhowells@redhat.com>, Markos Chandras <Markos.Chandras@imgtec.com>
Subject: Re: [PATCH v2] MIPS: ath79: Avoid using unitialized 'reg' variable
From: Ralf Baechle <ralf@linux-mips.org>
Date: Wed, 18 Sep 2013 15:51:56 +0200
Cc: linux-mips@linux-mips.org
In-reply-to: <20130918134533.GN22468@linux-mips.org>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1377082042-4219-1-git-send-email-markos.chandras@imgtec.com> <20130903133839.GA10563@linux-mips.org> <5225EC3B.1070701@imgtec.com> <20130918134533.GN22468@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Sep 18, 2013 at 03:45:33PM +0200, Ralf Baechle wrote:

> So here's a small test case to demonstrate the issue:
> 
> /*
>  * Definition of BUG taken from asm-generic/bug.h for the CONFIG_BUG=n case
>  */
> #define BUG()         do {} while(0)
> 
> int foo(int arg)
> {
>       int res;
> 
>       if (arg == 1)
>               res = 23;
>       else if (arg -= 2)

I fatfingered the testcase while editing the email.  this line of course
is "else if (arg == 2)"

  Ralf

<Prev in Thread] Current Thread [Next in Thread>