Subject: kern/5157: wdc_isa_attach missed setting sc_ad.dma_arg
To: None <gnats-bugs@gnats.netbsd.org>
From: None <sakamoto@cec.co.jp>
List: netbsd-bugs
Date: 03/13/1998 11:11:18
>Number:         5157
>Category:       kern
>Synopsis:       wdc_isa_attach missed setting sc_ad.dma_arg
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 12 18:20:01 1998
>Last-Modified:
>Originator:     Kazuki Sakamoto
>Organization:
cec
>Release:        NetBSD-current 1998Mar12
>Environment:
System: NetBSD saturn100 1.3 NetBSD 1.3 (SATURN) #0: Mon Jan 5 16:08:15 JST 1998 sakamoto@saturn100:/usr/src/sys/arch/i386/compile/SATURN i386


>Description:
	wdc_isa_attach() missed setting sc_ad.dma_arg.
	Therefore, wdc_isa_dma_setup() will use unassigned argument.

>How-To-Repeat:
	e.g.
	wdc0    at isa? port 0x1f0 irq 14 drq 5
	config, make kernel, reboot.

>Fix:

Index: wdc_isa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/isa/wdc_isa.c,v
retrieving revision 1.5
diff -c -r1.5 wdc_isa.c
*** wdc_isa.c	1998/01/27 19:14:18	1.5
--- wdc_isa.c	1998/03/13 01:20:00
***************
*** 153,159 ****
  		sc->sc_ad.dma_setup = &wdc_isa_dma_setup;
  		sc->sc_ad.dma_start = &wdc_isa_dma_start;
  		sc->sc_ad.dma_finish = &wdc_isa_dma_finish;
! 	}	
  
  	wdcattach(&sc->sc_wdcdev, &sc->sc_ad);
  }
--- 153,161 ----
  		sc->sc_ad.dma_setup = &wdc_isa_dma_setup;
  		sc->sc_ad.dma_start = &wdc_isa_dma_start;
  		sc->sc_ad.dma_finish = &wdc_isa_dma_finish;
! 
! 		sc->sc_ad.dma_arg = sc;
! 	}
  
  	wdcattach(&sc->sc_wdcdev, &sc->sc_ad);
  }
>Audit-Trail:
>Unformatted: