Add missing unmap to Close

This commit is contained in:
Drahoslav 2018-01-12 15:45:34 +01:00
parent 15b37924a8
commit 544f9accf1

View File

@ -500,12 +500,13 @@ func Open() (err error) {
return
}
// Memory map clock reisters to slice
// Memory map clock registers to slice
clkMem, clkMem8, err = memMap(file.Fd(), clkBase)
if err != nil {
return
}
// Memory map pwm registers to slice
pwmMem, pwmMem8, err = memMap(file.Fd(), pwmBase)
if err != nil {
return
@ -543,6 +544,9 @@ func Close() error {
if err := syscall.Munmap(clkMem8); err != nil {
return err
}
if err := syscall.Munmap(pwmMem8); err != nil {
return err
}
return nil
}