Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Dec 2004 05:16:25 GMT
From:      Ken Westerback <krw@openbsd.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/75532: aic79xx.c has two incorrect references to scb->hscb->tag instead of SCB_GET_TAG(scb)
Message-ID:  <200412270516.iBR5GPtm074322@www.freebsd.org>
Resent-Message-ID: <200412270520.iBR5KF0X065469@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412270516.iBR5GPtm074322>