NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50849: Relax TC option ROM header check for ROM widths < 4



The following reply was made to PR kern/50849; it has been noted by GNATS.

From: Felix Deichmann <m4j0rd0m0%gmail.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/50849: Relax TC option ROM header check for ROM widths < 4
Date: Tue, 19 Jul 2016 18:08:35 +0200

 There is another issue in tc_checkslot() where a continue statement 
 seems to be intended for an outer for-loop, but in fact acts on the 
 inner for-loop.
 
 Updated patch follows:
 
 Index: tc.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/tc/tc.c,v
 retrieving revision 1.51
 diff -u -p -r1.51 tc.c
 --- tc.c	4 Jun 2011 01:57:34 -0000	1.51
 +++ tc.c	19 Jul 2016 16:01:06 -0000
 @@ -223,23 +223,25 @@ tc_checkslot(tc_addr_t slotbase, char *n
   			break;
 
   		default:
 -			continue;
 +			goto next;
   		}
 
   		if (romp->tcr_stride.v != 4)
 -			continue;
 +			goto next;
 
 -		for (j = 0; j < 4; j++)
 +		for (j = 0; j < romp->tcr_width.v; j++)
   			if (romp->tcr_test[j+0*romp->tcr_stride.v] != 0x55 ||
   			    romp->tcr_test[j+1*romp->tcr_stride.v] != 0x00 ||
   			    romp->tcr_test[j+2*romp->tcr_stride.v] != 0xaa ||
   			    romp->tcr_test[j+3*romp->tcr_stride.v] != 0xff)
 -				continue;
 +				goto next;
 
   		for (j = 0; j < TC_ROM_LLEN; j++)
   			namep[j] = romp->tcr_modname[j].v;
   		namep[j] = '\0';
   		return (1);
 +next:
 +		/* null statement */;
   	}
   	return (0);
   }
 



Home | Main Index | Thread Index | Old Index