Skip to content

Commit

Permalink
uevent: should close uevent channel
Browse files Browse the repository at this point in the history
Signed-off-by: Vicente Cheng <[email protected]>
  • Loading branch information
Vicente-Cheng authored and bk201 committed Jan 25, 2024
1 parent a8c2931 commit 69de43f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/udev/uevent.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func (u *Udev) monitor(ctx context.Context, errors chan error) {
uqueue := make(chan netlink.UEvent)
errChan := make(chan error)
quit := conn.Monitor(uqueue, errChan, matcher)
defer close(quit)

// simulator the error from udev monitor
if u.injectError {
Expand All @@ -91,7 +92,6 @@ func (u *Udev) monitor(ctx context.Context, errors chan error) {
errors <- err
return
case <-ctx.Done():
close(quit)
return
}
}
Expand Down

0 comments on commit 69de43f

Please sign in to comment.