Skip to content

Commit

Permalink
mm: typo in mmap() input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
jewelcodes committed Nov 30, 2024
1 parent 3a48766 commit 5bc0538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/memory/mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void *mmap(Thread *t, uint64_t id, void *addr, size_t len, int prot, int flags,
if(!p) return (void *) -ESRCH;

IODescriptor *io = &p->io[fd];
if(io->valid || !io->data) return (void *) -EBADF;
if(!io->valid || !io->data) return (void *) -EBADF;
if(io->type != IO_FILE) return (void *) -ENODEV;

FileDescriptor *f = (FileDescriptor *) io->data;
Expand Down

0 comments on commit 5bc0538

Please sign in to comment.