Protect against count of chars received being 0, which causes a panic

otherwise. Can apparantly happen with some firmware revs.

Submitted by:	Kouichi Hirabayashi <kh@mogami-wire.co.jp>
This commit is contained in:
David Greenman 1998-03-18 20:52:28 +00:00
parent 41c01ead61
commit 4d88b7963a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=34661
3 changed files with 9 additions and 3 deletions

View File

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
* $Id: cy.c,v 1.61 1998/02/13 12:45:47 phk Exp $
*/
#include "opt_compat.h"
@ -1122,6 +1122,8 @@ siointr(unit)
int ifree;
count = cd_inb(iobase, CD1400_RDCR, cy_align);
if (!count)
goto cont;
com->bytes_in += count;
ioptr = com->iptr;
ifree = com->ibufend - ioptr;

View File

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
* $Id: cy.c,v 1.61 1998/02/13 12:45:47 phk Exp $
*/
#include "opt_compat.h"
@ -1122,6 +1122,8 @@ siointr(unit)
int ifree;
count = cd_inb(iobase, CD1400_RDCR, cy_align);
if (!count)
goto cont;
com->bytes_in += count;
ioptr = com->iptr;
ifree = com->ibufend - ioptr;

View File

@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: cy.c,v 1.60 1998/01/24 02:54:17 eivind Exp $
* $Id: cy.c,v 1.61 1998/02/13 12:45:47 phk Exp $
*/
#include "opt_compat.h"
@ -1122,6 +1122,8 @@ siointr(unit)
int ifree;
count = cd_inb(iobase, CD1400_RDCR, cy_align);
if (!count)
goto cont;
com->bytes_in += count;
ioptr = com->iptr;
ifree = com->ibufend - ioptr;