Skip to content

Commit

Permalink
csr1212: check results of keyval reads
Browse files Browse the repository at this point in the history
csr1212_parse_csr() did not properly check return values when reading
keyvals.  Fix this by using _csr1212_read_keyval() instead of
csr1212_get_keyval() and checking the return code.

Signed-off-by: Jody McIntyre <scjody@steamballoon.com>
  • Loading branch information
Jody McIntyre authored and Jody McIntyre committed Nov 22, 2005
1 parent b12479d commit 5303a98
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/ieee1394/csr1212.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,15 +1610,16 @@ int csr1212_parse_csr(struct csr1212_csr *csr)
csr->root_kv->valid = 0;
csr->root_kv->next = csr->root_kv;
csr->root_kv->prev = csr->root_kv;
csr1212_get_keyval(csr, csr->root_kv);
ret = _csr1212_read_keyval(csr, csr->root_kv);
if (ret != CSR1212_SUCCESS)
return ret;

/* Scan through the Root directory finding all extended ROM regions
* and make cache regions for them */
for (dentry = csr->root_kv->value.directory.dentries_head;
dentry; dentry = dentry->next) {
if (dentry->kv->key.id == CSR1212_KV_ID_EXTENDED_ROM) {
csr1212_get_keyval(csr, dentry->kv);

ret = _csr1212_read_keyval(csr, dentry->kv);
if (ret != CSR1212_SUCCESS)
return ret;
}
Expand Down

0 comments on commit 5303a98

Please sign in to comment.