if (ud != NULL) kfree(ud); 
kfree(ud); 
static struct unit_directory *nodemgr_process_unit_directory	(struct host_info *hi, struct node_entry *ne, struct csr1212_keyval *ud_kv,	 unsigned int *id, struct unit_directory *parent){	struct unit_directory *ud;	struct unit_directory *ud_child = NULL;	struct csr1212_dentry *dentry;	struct csr1212_keyval *kv;	u8 last_key_id = 0;	ud = kmalloc(sizeof(struct unit_directory), GFP_KERNEL);	if (!ud)		goto unit_directory_error;	memset (ud, 0, sizeof(struct unit_directory));	ud->ne = ne;	ud->ignore_driver = ignore_drivers;	ud->address = ud_kv->offset + CSR1212_CONFIG_ROM_SPACE_BASE;	ud->ud_kv = ud_kv;	ud->id = (*id)++;	csr1212_for_each_dir_entry(ne->csr, kv, ud_kv, dentry) {		switch (kv->key.id) {		case CSR1212_KV_ID_VENDOR:			if (kv->key.type == CSR1212_KV_TYPE_IMMEDIATE) {				ud->vendor_id = kv->value.immediate;				ud->flags |= UNIT_DIRECTORY_VENDOR_ID;				if (ud->vendor_id)					ud->vendor_oui = nodemgr_find_oui_name(ud->vendor_id);			}			break;		case CSR1212_KV_ID_MODEL:			ud->model_id = kv->value.immediate;			ud->flags |= UNIT_DIRECTORY_MODEL_ID;			break;		case CSR1212_KV_ID_SPECIFIER_ID:			ud->specifier_id = kv->value.immediate;			ud->flags |= UNIT_DIRECTORY_SPECIFIER_ID;			break;		case CSR1212_KV_ID_VERSION:			ud->version = kv->value.immediate;			ud->flags |= UNIT_DIRECTORY_VERSION;			break;		case CSR1212_KV_ID_DESCRIPTOR:			if (kv->key.type == CSR1212_KV_TYPE_LEAF &&			    CSR1212_DESCRIPTOR_LEAF_TYPE(kv) == 0 &&			    CSR1212_DESCRIPTOR_LEAF_SPECIFIER_ID(kv) == 0 &&			    CSR1212_TEXTUAL_DESCRIPTOR_LEAF_WIDTH(kv) == 0 &&			    CSR1212_TEXTUAL_DESCRIPTOR_LEAF_CHAR_SET(kv) == 0 &&			    CSR1212_TEXTUAL_DESCRIPTOR_LEAF_LANGUAGE(kv) == 0) {				switch (last_key_id) {				case CSR1212_KV_ID_VENDOR:					ud->vendor_name_kv = kv;					csr1212_keep_keyval(kv);					break;				case CSR1212_KV_ID_MODEL:					ud->model_name_kv = kv;					csr1212_keep_keyval(kv);					break;				}			} /* else if (kv->key.type == CSR1212_KV_TYPE_DIRECTORY) ... */			break;		case CSR1212_KV_ID_DEPENDENT_INFO:			/* Logical Unit Number */			if (kv->key.type == CSR1212_KV_TYPE_IMMEDIATE) {				if (ud->flags & UNIT_DIRECTORY_HAS_LUN) {					ud_child = kmalloc(sizeof(struct unit_directory), GFP_KERNEL);					if (!ud_child)						goto unit_directory_error;					memcpy(ud_child, ud, sizeof(struct unit_directory));					nodemgr_register_device(ne, ud_child, &ne->device);					ud_child = NULL;										ud->id = (*id)++;				}				ud->lun = kv->value.immediate;				ud->flags |= UNIT_DIRECTORY_HAS_LUN;			/* Logical Unit Directory */			} else if (kv->key.type == CSR1212_KV_TYPE_DIRECTORY) {				/* This should really be done in SBP2 as this is				 * doing SBP2 specific parsing.				 */								/* first register the parent unit */				ud->flags |= UNIT_DIRECTORY_HAS_LUN_DIRECTORY;				if (ud->device.bus != &ieee1394_bus_type)					nodemgr_register_device(ne, ud, &ne->device);								/* process the child unit */				ud_child = nodemgr_process_unit_directory(hi, ne, kv, id, ud);				if (ud_child == NULL)					break;								/* inherit unspecified values so hotplug picks it up */				if ((ud->flags & UNIT_DIRECTORY_MODEL_ID) &&				    !(ud_child->flags & UNIT_DIRECTORY_MODEL_ID))				{					ud_child->flags |=  UNIT_DIRECTORY_MODEL_ID;					ud_child->model_id = ud->model_id;				}				if ((ud->flags & UNIT_DIRECTORY_SPECIFIER_ID) &&				    !(ud_child->flags & UNIT_DIRECTORY_SPECIFIER_ID))				{					ud_child->flags |=  UNIT_DIRECTORY_SPECIFIER_ID;					ud_child->specifier_id = ud->specifier_id;				}				if ((ud->flags & UNIT_DIRECTORY_VERSION) &&				    !(ud_child->flags & UNIT_DIRECTORY_VERSION))				{					ud_child->flags |=  UNIT_DIRECTORY_VERSION;					ud_child->version = ud->version;				}								/* register the child unit */				ud_child->flags |= UNIT_DIRECTORY_LUN_DIRECTORY;				nodemgr_register_device(ne, ud_child, &ud->device);			}			break;		default:			break;		}		last_key_id = kv->key.id;	}		/* do not process child units here and only if not already registered */	if (!parent && ud->device.bus != &ieee1394_bus_type)		nodemgr_register_device(ne, ud, &ne->device);	return ud;unit_directory_error:	if (ud != NULL)		kfree(ud);	return NULL;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/616b859fbd0e59707a24612d5b5fec791156c822/nodemgr.c/clean/drivers/ieee1394/nodemgr.c