Fix off by one in hpet_mmap() csw method.
Reported by: C Turt <ecturt@gmail.com> Reviewed by: alc, markj Tested by: pho admbug: 781 MFC after: 2 weeks Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
61e5f27315
commit
ea0a5b75bc
@ -396,7 +396,7 @@ hpet_mmap(struct cdev *cdev, vm_ooffset_t offset, vm_paddr_t *paddr,
|
||||
struct hpet_softc *sc;
|
||||
|
||||
sc = cdev->si_drv1;
|
||||
if (offset > rman_get_size(sc->mem_res))
|
||||
if (offset >= rman_get_size(sc->mem_res))
|
||||
return (EINVAL);
|
||||
if (!sc->mmap_allow_write && (nprot & PROT_WRITE))
|
||||
return (EPERM);
|
||||
|
Loading…
Reference in New Issue
Block a user