Change types of wdp_cylinders, wdp_heads and wdp_sectors in struct

wdparams from short into u_short.  If wdp_cylinders is short, it
overflows and cause serious sign extension bug when large IDE HDD is
used.  These members are only used for initialization of u_long
variables in both 3.0-current and RELENG_2_2 branch.

I believe this should be in 2.2.

Reviewed by:	Bruce Evans <bde@zeta.org.au>
This commit is contained in:
kato 1997-01-04 10:28:01 +00:00
parent 794d692ced
commit 14fe89930f

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wdreg.h 7.1 (Berkeley) 5/9/91
* $Id: wdreg.h,v 1.13 1996/11/02 10:37:08 asami Exp $
* $Id: wdreg.h,v 1.14 1996/11/14 08:45:40 asami Exp $
*/
/*
@ -142,12 +142,12 @@
struct wdparams {
/* drive info */
short wdp_config; /* general configuration bits */
short wdp_cylinders; /* number of cylinders */
u_short wdp_cylinders; /* number of cylinders */
short wdp_reserved;
short wdp_heads; /* number of heads */
u_short wdp_heads; /* number of heads */
short wdp_unfbytespertrk; /* number of unformatted bytes/track */
short wdp_unfbytes; /* number of unformatted bytes/sector */
short wdp_sectors; /* number of sectors per track */
u_short wdp_sectors; /* number of sectors per track */
short wdp_vendorunique[3];
/* controller info */
char wdp_serial[20]; /* serial number */