Changeset 17bf658 in mainline
- Timestamp:
- 2009-10-01T10:24:45Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0fc1e5d
- Parents:
- e6bc3a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
re6bc3a5 r17bf658 115 115 } 116 116 117 static fat_node_t *fat_node_get_new(void)117 static int fat_node_get_new(fat_node_t **nodepp) 118 118 { 119 119 fs_node_t *fn; … … 137 137 if (nodep->dirty) { 138 138 rc = fat_node_sync(nodep); 139 assert(rc == EOK); 139 if (rc != EOK) { 140 idxp_tmp->nodep = NULL; 141 fibril_mutex_unlock(&nodep->lock); 142 fibril_mutex_unlock(&idxp_tmp->lock); 143 free(nodep->bp); 144 free(nodep); 145 return rc; 146 } 140 147 } 141 148 idxp_tmp->nodep = NULL; … … 149 156 fn = (fs_node_t *)malloc(sizeof(fs_node_t)); 150 157 if (!fn) 151 return NULL;158 return ENOMEM; 152 159 nodep = (fat_node_t *)malloc(sizeof(fat_node_t)); 153 160 if (!nodep) { 154 161 free(fn); 155 return NULL;162 return ENOMEM; 156 163 } 157 164 } … … 161 168 nodep->bp = fn; 162 169 163 return nodep; 170 *nodepp = nodep; 171 return EOK; 164 172 } 165 173 … … 200 208 assert(idxp->pfc); 201 209 202 nodep = fat_node_get_new();203 if ( !nodep)210 rc = fat_node_get_new(&nodep); 211 if (rc != EOK) 204 212 return NULL; 205 213 … … 432 440 } 433 441 434 nodep = fat_node_get_new();435 if ( !nodep) {442 rc = fat_node_get_new(&nodep); 443 if (rc != EOK) { 436 444 (void) fat_free_clusters(bs, dev_handle, mcl); 437 return ENOMEM; /* FIXME: determine the true error code */445 return rc; 438 446 } 439 447 idxp = fat_idx_get_new(dev_handle);
Note:
See TracChangeset
for help on using the changeset viewer.