Bug 156513 - [aic7xxx] [patch] missing check of scb.
Summary: [aic7xxx] [patch] missing check of scb.
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-20 08:20 UTC by henning.petersen
Modified: 2017-12-31 22:32 UTC (History)
0 users

See Also:


Attachments
file.diff (1.18 KB, patch)
2011-04-20 08:20 UTC, henning.petersen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description henning.petersen 2011-04-20 08:20:08 UTC
Missing check of scb != NULL.
Remove debug printf.
Remove unused variable.

Fix: diff -u -r1.42 aic79xx.c
--- sys/dev/aic7xxx/aic79xx.c	12 Mar 2011 20:36:52 -0000	1.42
+++ sys/dev/aic7xxx/aic79xx.c	20 Apr 2011 06:56:47 -0000
@@ -1062,7 +1062,6 @@
 			struct	scb *scb;
 			struct	ahd_initiator_tinfo *targ_info;
 			struct	ahd_tmode_tstate *tstate;
-			struct	ahd_transinfo *tinfo;
 			u_int	scbid;
 
 			/*
@@ -1096,7 +1095,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,
@@ -2262,7 +2260,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)) {
@@ -2406,7 +2403,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);
 		aic_set_transaction_status(scb, CAM_REQUEUE_REQ);


Patch attached with submission follows:
Comment 1 Remko Lodder freebsd_committer 2011-04-20 20:55:30 UTC
Responsible Changed
From-To: freebsd-bugs->scottl

Is this something you might want to have a look at?
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 07:59:53 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped