Changeset 7a56b1ed in mainline


Ignore:
Timestamp:
2009-09-01T21:16:20Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cd3e6a2, cffce57
Parents:
4f690cd
Message:

Out of memory condition in block_get() can be handled by returning ENOMEM.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libblock/libblock.c

    r4f690cd r7a56b1ed  
    383383                        unsigned long temp_key;
    384384recycle:
    385                         assert(!list_empty(&cache->free_head));
     385                        if (list_empty(&cache->free_head)) {
     386                                fibril_mutex_unlock(&cache->lock);
     387                                rc = ENOMEM;
     388                                goto out;
     389                        }
    386390                        l = cache->free_head.next;
    387391                        b = list_get_instance(l, block_t, free_link);
     
    468472                fibril_mutex_unlock(&b->lock);
    469473        }
     474out:
    470475        if ((rc != EOK) && b) {
    471476                assert(b->toxic);
Note: See TracChangeset for help on using the changeset viewer.