A lot of code in the kernel uses the following pattern:
if (fn() < 0) {
return -1;
}
This discards the error code and replaces it with a generic -1. If we ever want to start returning proper error codes like EINVAL, ENOMEM, etc, we need to replace this with:
if ((ret = fn()) < 0) {
return ret;
}