Skip to content

Commit

Permalink
In ConfigureInterface(),the defer closure misuse outter 'err' to chec…
Browse files Browse the repository at this point in the history
…k nil ,not 'cerr' inside the closure.

Signed-off-by: youngifif <[email protected]>
  • Loading branch information
youngifif committed Jun 3, 2024
1 parent 51bc613 commit 961a741
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion netboot/netconf.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func ConfigureInterface(ifname string, netconf *NetConf) (err error) {
return err
}
defer func() {
if cerr := rt.Close(); err != nil {
if cerr := rt.Close(); cerr != nil {
err = cerr
}
}()
Expand Down

0 comments on commit 961a741

Please sign in to comment.