summaryrefslogtreecommitdiff
path: root/ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'ide.c')
-rw-r--r--ide.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ide.c b/ide.c
index 96216ea..ed5a572 100644
--- a/ide.c
+++ b/ide.c
@@ -48,7 +48,7 @@ void
ideinit(void)
{
int i;
-
+
initlock(&idelock, "ide");
picenable(IRQ_IDE);
ioapicenable(IRQ_IDE, ncpu - 1);
@@ -73,6 +73,8 @@ idestart(struct buf *b)
{
if(b == 0)
panic("idestart");
+ if(b->blockno >= FSSIZE)
+ panic("incorrect blockno");
int sector_per_block = BSIZE/SECTOR_SIZE;
int sector = b->blockno * sector_per_block;