From nobody@FreeBSD.ORG Fri Apr 30 15:21:09 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 2BAF114EB7; Fri, 30 Apr 1999 15:21:09 -0700 (PDT)
Message-Id: <19990430222109.2BAF114EB7@hub.freebsd.org>
Date: Fri, 30 Apr 1999 15:21:09 -0700 (PDT)
From: cpeterso@cs.washington.edu
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: code typo in clones.c: "if ((mpu_config = NULL))" should be "if ((mpu_config != NULL))"
X-Send-Pr-Version: www-1.0

>Number:         11411
>Category:       kern
>Synopsis:       code typo in clones.c: "if ((mpu_config = NULL))" should be "if ((mpu_config != NULL))"
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 30 15:30:01 PDT 1999
>Closed-Date:    Tue Jun 27 01:15:11 PDT 2000
>Last-Modified:  Tue Jun 27 01:16:20 PDT 2000
>Originator:     Christopher Peterson
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
>Environment:
>Description:
i386/isa/snd/clones.c (line 217):	if (X=0) 3:
	if((mpu_config=NULL))
should be:
	if ((mpu_config != NULL)) {

>How-To-Repeat:

>Fix:
	if ((mpu_config != NULL)) {


>Release-Note:
>Audit-Trail:

From: "Daniel C. Sobral" <dcs@newsguy.com>
To: cpeterso@cs.washington.edu
Cc: freebsd-gnats-submit@FreeBSD.ORG,
	Luigi Rizzo <luigi@labinfo.iet.unipi.it>
Subject: Re: kern/11411: code typo in clones.c: "if ((mpu_config = NULL))" should 
 be "if ((mpu_config != NULL))"
Date: Sat, 01 May 1999 10:57:47 +0900

 cpeterso@cs.washington.edu wrote:
 > 
 > >Description:
 > i386/isa/snd/clones.c (line 217):       if (X=0) 3:
 >         if((mpu_config=NULL))
 
 > should be:
 >         if ((mpu_config != NULL)) {
 
 Not exactly. Man style.
 
 That said... The double parenthesis on the above line do nothing
 except *HIDE* the error! That is, supposing it *is* an error (I
 cannot conceive it not being one)... This is just the kind of thing
 that should *not* be done (thoughless "fix" of warnings).
 
 Now, that said... It is all the better that it is written this way.
 If your changes were to be committed, it would introduce a bug.
 
 See, mpu_config is a local variable, and it is *not* static, and it
 has *not* been initialized. So, the above line initializes it, and,
 at the same time, executes the correct branch of the code. After
 your changes, we would risk values being initialized from structure
 elements of an unitialized pointer.
 
 --
 Daniel C. Sobral			(8-DCS)
 dcs@newsguy.com
 dcs@freebsd.org
 
 	"Proof of Trotsky's farsightedness if that _none_ of his
 predictions have come true yet."
 
State-Changed-From-To: open->closed 
State-Changed-By: nbm 
State-Changed-When: Tue Jun 27 01:15:11 PDT 2000 
State-Changed-Why:  
This dead code was removed by peter in 1.4 of snd/clones.c.  The 
reported problem was not really an error. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=11411 
>Unformatted:
