From 544f9accf177f67f65b622c47cee2d2dfcd93128 Mon Sep 17 00:00:00 2001 From: Drahoslav Date: Fri, 12 Jan 2018 15:45:34 +0100 Subject: [PATCH] Add missing unmap to Close --- rpio.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rpio.go b/rpio.go index 3d3ce71..62109ce 100644 --- a/rpio.go +++ b/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 }