From nobody@FreeBSD.org  Sat Sep  6 03:00:22 2008
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id BB4DE1065674
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Sep 2008 03:00:22 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21])
	by mx1.freebsd.org (Postfix) with ESMTP id 7D1668FC14
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  6 Sep 2008 03:00:17 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m8630Hao069662
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 6 Sep 2008 03:00:17 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.14.2/8.14.1/Submit) id m8630H0M069661;
	Sat, 6 Sep 2008 03:00:17 GMT
	(envelope-from nobody)
Message-Id: <200809060300.m8630H0M069661@www.freebsd.org>
Date: Sat, 6 Sep 2008 03:00:17 GMT
From: Fritz Katz <frtzkatz@yahoo.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /usr/src/sys/dev/bktr/bktr_os.c, line 469: wrong type in bus_release_resource
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         127131
>Category:       kern
>Synopsis:       [bktr] /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-multimedia
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Sep 06 03:10:01 UTC 2008
>Closed-Date:    Thu Feb 13 17:33:11 CET 2014
>Last-Modified:  Thu Feb 13 17:33:11 CET 2014
>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@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:
Responsible-Changed-From-To: freebsd-bugs->freebsd-multimedia 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Sep 6 03:22:16 UTC 2008 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=127131 
State-Changed-From-To: open->closed 
State-Changed-By: brueffer 
State-Changed-When: Thu Feb 13 17:32:16 CET 2014 
State-Changed-Why:  
The patch was applied in r192784 (almost 5 years ago).  Time to close 
this PR.  Thanks for the patch! 

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