From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 27 05:20:16 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1D8FD16A500 for ; Mon, 27 Dec 2004 05:20:16 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2CF843D41 for ; Mon, 27 Dec 2004 05:20:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.1/8.13.1) with ESMTP id iBR5KFom065471 for ; Mon, 27 Dec 2004 05:20:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.1/8.13.1/Submit) id iBR5KF0X065469; Mon, 27 Dec 2004 05:20:15 GMT (envelope-from gnats) Resent-Date: Mon, 27 Dec 2004 05:20:15 GMT Resent-Message-Id: <200412270520.iBR5KF0X065469@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ken Westerback Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 41C5816A4CE for ; Mon, 27 Dec 2004 05:16:26 +0000 (GMT) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id 26B9943D55 for ; Mon, 27 Dec 2004 05:16:26 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id iBR5GPrb074324 for ; Mon, 27 Dec 2004 05:16:25 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id iBR5GPtm074322; Mon, 27 Dec 2004 05:16:25 GMT (envelope-from nobody) Message-Id: <200412270516.iBR5GPtm074322@www.freebsd.org> Date: Mon, 27 Dec 2004 05:16:25 GMT From: Ken Westerback To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Subject: kern/75532: aic79xx.c has two incorrect references to scb->hscb->tag instead of SCB_GET_TAG(scb) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Dec 2004 05:20:16 -0000 >Number: 75532 >Category: kern >Synopsis: aic79xx.c has two incorrect references to scb->hscb->tag instead of SCB_GET_TAG(scb) >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 27 05:20:15 GMT 2004 >Closed-Date: >Last-Modified: >Originator: Ken Westerback >Release: n/a >Organization: >Environment: n/a >Description: While working to port the latest ahd code to OpenBSD I found two apparently incorrect uses of scb->hscb->tag rather than the usual define SCB_GET_TAG(scb). In the diff below I also changed the affected printf() statement to use 'SCB %d' instead of 'SCB 0x%x', as the former seems more consitantly used in displays. While the scb->hscb->tag in the printf is operationally benign, I think the other use could cause incorrect searches of the qinfifo. >How-To-Repeat: >Fix: Index: aic79xx.c =================================================================== RCS file: /home/ncvs/src/sys/dev/aic7xxx/aic79xx.c,v retrieving revision 1.33 diff -u -r1.33 aic79xx.c --- aic79xx.c 18 Nov 2004 20:22:30 -0000 1.33 +++ aic79xx.c 27 Dec 2004 05:07:03 -0000 @@ -9354,7 +9354,7 @@ lun = SCB_GET_LUN(scb); ahd_print_path(ahd, scb); - printf("SCB 0x%x - timed out\n", scb->hscb->tag); + printf("SCB %d - timed out\n", SCB_GET_TAG(scb)); if (scb->flags & (SCB_DEVICE_RESET|SCB_ABORT)) { /* @@ -9421,7 +9421,7 @@ "Identify Msg.\n", ahd_name(ahd)); goto bus_reset; } else if (ahd_search_qinfifo(ahd, target, channel, lun, - scb->hscb->tag, ROLE_INITIATOR, + SCB_GET_TAG(scb), ROLE_INITIATOR, /*status*/0, SEARCH_COUNT) > 0) { /* >Release-Note: >Audit-Trail: >Unformatted: