mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
bce: Fix SYSCTL_IN error check in bce_sysctl_nvram_write()
The condition after SYSCTL_IN was inverted: success (error == 0) returned immediately and skipped the NVRAM write path, while failure fell through. Return only when SYSCTL_IN fails. Signed-off-by: Weixie Cui <[email protected]> Reviewed-by: ngie Pull-Request: https://github.com/freebsd/freebsd-src/pull/2113
This commit is contained in:
1 parent
f81c1f4339
commit
f3b59bf285
1 file changed
+1
-1
@@ -8861,7 +8861,7 @@ bce_sysctl_nvram_write(SYSCTL_HANDLER_ARGS)
|
||||
bzero(sc->nvram_buf, sc->bce_flash_size);
|
||||
|
||||
error = SYSCTL_IN(req, sc->nvram_buf, sc->bce_flash_size);
|
||||
if (error == 0)
|
||||
if (error != 0)
|
||||
return (error);
|
||||
|
||||
if (req->newlen == sc->bce_flash_size)
|
||||
|
||||
Reference in new issue
Block a user