CSR1212_KV_VAL(ki));
if (!k) {
ret = -ENOMEM;
- goto fail;
+ goto out;
}
k->refcnt = 0; /* Don't keep local reference when parsing. */
CSR1212_KV_VAL(ki));
if (!k) {
ret = -ENOMEM;
- goto fail;
+ goto out;
}
k->refcnt = 0; /* Don't keep local reference when parsing. */
break;
* or Directories. The Config ROM image is most likely
* messed up, so we'll just abort here. */
ret = -EIO;
- goto fail;
+ goto out;
}
k = csr1212_find_keyval_offset(dir, offset);
if (!k) {
ret = -ENOMEM;
- goto fail;
+ goto out;
}
k->refcnt = 0; /* Don't keep local reference when parsing. */
k->valid = 0; /* Contents not read yet so it's not valid. */
dir->next = k;
}
ret = csr1212_attach_keyval_to_directory(dir, k);
-
-fail:
+out:
if (ret != CSR1212_SUCCESS && k != NULL)
free_keyval(k);
return ret;
if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) &&
(csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) {
ret = -EINVAL;
- goto fail;
+ goto out;
}
#endif
kv->value.leaf.data = CSR1212_MALLOC(size);
if (!kv->value.leaf.data) {
ret = -ENOMEM;
- goto fail;
+ goto out;
}
kv->value.leaf.len = kvi_len;
}
kv->valid = 1;
-
-fail:
+out:
return ret;
}