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:
Weixie Cui authored and Enji Cooper committed 2026-04-01 00:29:46 -07:00
1 parent f81c1f4339
commit f3b59bf285
1 file changed
+1 -1
+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)