kern/127131: /usr/src/sys/dev/bktr/bktr_os.c, line 469: wrong type in bus_release_resource

Fritz Katz frtzkatz at yahoo.com
Sat Sep 6 03:10:02 UTC 2008


>Number:         127131
>Category:       kern
>Synopsis:       /usr/src/sys/dev/bktr/bktr_os.c, line 469: wrong type in bus_release_resource
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 06 03:10:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Fritz Katz
>Release:        7.0-RELEASE i386
>Organization:
AAArt Corp.
>Environment:
FreeBSD nvdev.AAArt.com 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Wed May 21 13:31:32 PDT 2008     root at nvdev.AAArt.com:/usr/obj/usr/src/sys/AAART  i386

>Description:
In FreeBSD-7.0, /usr/src/sys/dev/bktr/bktr_os.c, line 469:

http://fxr.watson.org/fxr/source/dev/bktr/bktr_os.c?v=FREEBSD70#L469
__________

fail:
  if (bktr->res_irq)
     bus_release_resource(dev, SYS_RES_IRQ, bktr->irq_rid, bktr->res_irq);
  if (bktr->res_mem)
     bus_release_resource(dev, SYS_RES_IRQ, bktr->mem_rid, bktr->res_mem);
  return error;
__________

Shouldn't the type field for the second bus_release_resource be SYS_RES_MEMORY?  Would it cause a kernel panic if it were ever hit?  If it is a bug, it's probably been there for years.

>How-To-Repeat:
if the bktr driver fails to load, this code will be hit.

>Fix:
replace SYS_RES_IRQ with SYS_RES_MEMORY in the second bus_release_resource.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list