Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 251d4dd in mainline for uspace/srv/fs/cdfs/cdfs_ops.c


Ignore:
Timestamp:
2014-08-03T15:43:29Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
f2f4c00
Parents:
c2844735
Message:

Fix crash when cdfs is cleaning its node cache.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/cdfs/cdfs_ops.c

    rc2844735 r251d4dd  
    249249        cdfs_node_t *node = hash_table_get_inst(item, cdfs_node_t, nh_link);
    250250       
    251         assert(node->type == CDFS_DIRECTORY);
    252        
    253         link_t *link;
    254         while ((link = list_first(&node->cs_list)) != NULL) {
    255                 cdfs_dentry_t *dentry = list_get_instance(link, cdfs_dentry_t, link);
    256                 list_remove(&dentry->link);
    257                 free(dentry);
     251        if (node->type == CDFS_DIRECTORY) {
     252                link_t *link;
     253                while ((link = list_first(&node->cs_list)) != NULL) {
     254                        cdfs_dentry_t *dentry = list_get_instance(link, cdfs_dentry_t, link);
     255                        list_remove(&dentry->link);
     256                        free(dentry);
     257                }
    258258        }
    259259       
Note: See TracChangeset for help on using the changeset viewer.