mirror of
https://github.com/stianeikeland/go-rpio.git
synced 2025-01-23 02:31:05 +01:00
Add missing unmap to Close
This commit is contained in:
parent
15b37924a8
commit
544f9accf1
6
rpio.go
6
rpio.go
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user