summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2000-02-13 11:23:16 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2000-02-13 11:23:16 +0000
commita4fd1a6147ce5788e91e16d857b06fd334068915 (patch)
tree43619ed45c7d635dc9dab9e03a1225dc5463800f /sys/dev
parent42d2bc1575cab2122d474d8ed00c3f6a767af83c (diff)
Handle out-of-bounds errors correctly
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/gdt_common.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c
index 58ff4f729cd..b18c608854d 100644
--- a/sys/dev/ic/gdt_common.c
+++ b/sys/dev/ic/gdt_common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gdt_common.c,v 1.3 2000/02/13 10:56:41 niklas Exp $ */
+/* $OpenBSD: gdt_common.c,v 1.4 2000/02/13 11:23:15 niklas Exp $ */
/*
* Copyright (c) 1999, 2000 Niklas Hallqvist. All rights reserved.
@@ -555,9 +555,11 @@ gdt_scsi_cmd(xs)
}
if (blockno >= gdt->sc_hdr[target].hd_size ||
blockno + blockcnt > gdt->sc_hdr[target].hd_size) {
+ GDT_UNLOCK_GDT(gdt);
printf("%s: out of bounds %u-%u >= %u\n",
gdt->sc_dev.dv_xname, blockno, blockcnt,
gdt->sc_hdr[target].hd_size);
+ scsi_done(xs);
xs->error = XS_DRIVER_STUFFUP;
return (COMPLETE);
}