LASSERT(type != NULL);
size = type->cht_size;
- if (hash_len == NULL) {
+ if (hash == NULL || hash_len == NULL) {
err = 0;
goto free;
}
- if (hash == NULL || *hash_len < size) {
- err = -ENOMEM;
+ if (*hash_len < size) {
+ err = -EOVERFLOW;
goto free;
}