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 <cuiweixie@gmail.com>
Reviewed-by: ngie
Pull-Request: https://github.com/freebsd/freebsd-src/pull/2113
This commit is contained in:
Weixie Cui
2026-03-31 21:51:46 +08:00
committed by Enji Cooper
parent f81c1f4339
commit f3b59bf285
+1 -1
View File
@@ -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)