> + ret = kstrtoull(buf, base, &val);> + if (!ret)> + *result = val;Simply pass "result" directly to kstrtoull(). It will not write the resultin case of error.