From owner-freebsd-bugs Mon May 19 05:30:06 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA18395 for bugs-outgoing; Mon, 19 May 1997 05:30:06 -0700 (PDT) Received: (from gnats@localhost) by hub.freebsd.org (8.8.5/8.8.5) id FAA18387; Mon, 19 May 1997 05:30:03 -0700 (PDT) Resent-Date: Mon, 19 May 1997 05:30:03 -0700 (PDT) Resent-Message-Id: <199705191230.FAA18387@hub.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@FreeBSD.ORG, simokawa@sat.t.u-tokyo.ac.jp Received: from mail.sat.t.u-tokyo.ac.jp (dryad.sat.t.u-tokyo.ac.jp [133.11.70.140]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id FAA18250 for ; Mon, 19 May 1997 05:27:46 -0700 (PDT) Received: by mail.sat.t.u-tokyo.ac.jp (8.7.5+2.6Wbeta7/3.4Wbeta6-SAT1.0) with ESMTP id VAA05187; Mon, 19 May 1997 21:27:28 +0900 (JST) Received: by ichi.sat.t.u-tokyo.ac.jp (8.8.5/sat-V0.6) id VAA00503; Mon, 19 May 1997 21:27:28 +0900 (JST) Message-Id: <199705191227.VAA00503@ichi.sat.t.u-tokyo.ac.jp> Date: Mon, 19 May 1997 21:27:28 +0900 (JST) From: Hidetoshi Shimokawa Reply-To: simokawa@sat.t.u-tokyo.ac.jp To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: kern/3629: /sys/scsi/pt.c doesn't initialize buf_queue Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk >Number: 3629 >Category: kern >Synopsis: /sys/scsi/pt.c doesn't initialize buf_queue >Confidential: no >Severity: critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon May 19 05:30:01 PDT 1997 >Last-Modified: >Originator: Hidetoshi Shimokawa >Organization: Univ. of Tokyo >Release: FreeBSD 2.2-STABLE i386 >Environment: FreeBSD-2.2 + EPSON scanner (processor type SCSI device) >Description: pt.c is using pt->buf_queue without initialization. >How-To-Repeat: I found this bug while writing scanner control program. >Fix: Please apply the following patch *** pt.c.org Sat Sep 7 08:09:12 1996 --- pt.c Mon May 19 21:00:56 1997 *************** *** 86,92 **** 0, {0, 0}, SDEV_ONCE_ONLY, /* Only one open allowed */ ! 0, "Processor", ptopen, sizeof(struct scsi_data), --- 86,92 ---- 0, {0, 0}, SDEV_ONCE_ONLY, /* Only one open allowed */ ! ptattach, "Processor", ptopen, sizeof(struct scsi_data), *************** *** 98,103 **** --- 98,112 ---- 0, pt_strategy, }; + + static errval + ptattach(struct scsi_link *sc_link) + { + struct scsi_data *pt = sc_link->sd; + + TAILQ_INIT(&pt->buf_queue); + return 0; + } /* * ptstart looks to see if there is a buf waiting for the device And, I appreciate if you add the following entry in scsiconf.c I would like to submit scanner control program as port later. #if NPT > 0 { T_PROCESSOR, T_PROCESSOR, T_FIXED, "EPSON SC", "*", "*", "pt", SC_ONE_LU }, #endif /* NPT */ >Audit-Trail: >Unformatted: