NetBSD Problem Report #44885

From www@NetBSD.org  Wed Apr 20 07:15:27 2011
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 7014C63C2B8
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 20 Apr 2011 07:15:27 +0000 (UTC)
Message-Id: <20110420071526.CF56163BBDB@www.NetBSD.org>
Date: Wed, 20 Apr 2011 07:15:26 +0000 (UTC)
From: henning.petersen@t-online.de
Reply-To: henning.petersen@t-online.de
To: gnats-bugs@NetBSD.org
Subject: Missinf check of scb.
X-Send-Pr-Version: www-1.0

>Number:         44885
>Category:       kern
>Synopsis:       Missinf check of scb.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 20 07:20:01 +0000 2011
>Originator:     Henning Petersen
>Release:        NetBSD-current
>Organization:
>Environment:
>Description:
Missing check of scb != NULL.
Remove debug printf.
Remove unused variable.
>How-To-Repeat:

>Fix:
diff -u -r1.44 aic79xx.c
--- sys/dev/ic/aic79xx.c	3 Sep 2009 14:52:22 -0000	1.44
+++ sys/dev/ic/aic79xx.c	20 Apr 2011 06:54:35 -0000
@@ -1027,7 +1027,6 @@
 			struct	scb *scb;
 			struct	ahd_initiator_tinfo *targ_info;
 			struct	ahd_tmode_tstate *tstate;
-			struct	ahd_transinfo *tinfo;
 			u_int	scbid;

 			/*
@@ -1060,7 +1059,6 @@
 							devinfo.our_scsiid,
 							devinfo.target,
 							&tstate);
-			tinfo = &targ_info->curr;
 			ahd_set_width(ahd, &devinfo, MSG_EXT_WDTR_BUS_8_BIT,
 				      AHD_TRANS_ACTIVE, /*paused*/TRUE);
 			ahd_set_syncrate(ahd, &devinfo, /*period*/0,
@@ -2185,7 +2183,6 @@
 			found = ahd_abort_scbs(ahd, target, 'A', saved_lun,
 					       tag, ROLE_INITIATOR,
 					       CAM_REQ_ABORTED);
-			printf("found == 0x%x\n", found);
 			printerror = 0;
 		} else if (ahd_sent_msg(ahd, AHDMSG_1B,
 					MSG_BUS_DEV_RESET, TRUE)) {
@@ -2288,7 +2285,8 @@
 	 */
 	if (printerror != 0
 	 && (lastphase == P_MESGIN || lastphase == P_MESGOUT)
-	 && ((ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0)) {
+	 && ((ahd->msg_flags & MSG_FLAG_EXPECT_PPR_BUSFREE) != 0)
+	 && scb != NULL) {

 		ahd_freeze_devq(ahd, scb);
 		ahd_set_transaction_status(scb, CAM_REQUEUE_REQ);

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.