if (ps) { if (ps->area) free_area(ps);  kfree(ps); } 
if (ps && ps->area) free_area(ps); kfree(ps); 
int dm_create_persistent(struct exception_store *store, uint32_t chunk_size){	int r;	struct pstore *ps;	r = dm_io_get(sectors_to_pages(chunk_size));	if (r)		return r;	/* allocate the pstore */	ps = kmalloc(sizeof(*ps), GFP_KERNEL);	if (!ps) {		r = -ENOMEM;		goto bad;	}	ps->snap = store->snap;	ps->valid = 1;	ps->version = SNAPSHOT_DISK_VERSION;	ps->chunk_size = chunk_size;	ps->exceptions_per_area = (chunk_size << SECTOR_SHIFT) /	    sizeof(struct disk_exception);	ps->next_free = 2;	/* skipping the header and first area */	ps->current_committed = 0;	r = alloc_area(ps);	if (r)		goto bad;	/*	 * Allocate space for all the callbacks.	 */	ps->callback_count = 0;	atomic_set(&ps->pending_count, 0);	ps->callbacks = dm_vcalloc(ps->exceptions_per_area,				   sizeof(*ps->callbacks));	if (!ps->callbacks) {		r = -ENOMEM;		goto bad;	}	store->destroy = persistent_destroy;	store->read_metadata = persistent_read_metadata;	store->prepare_exception = persistent_prepare;	store->commit_exception = persistent_commit;	store->drop_snapshot = persistent_drop;	store->fraction_full = persistent_fraction_full;	store->context = ps;	return 0;      bad:	dm_io_put(sectors_to_pages(chunk_size));	if (ps) {		if (ps->area)			free_area(ps);		kfree(ps);	}	return r;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/f9101210e7aa72daf92722d451a2f7e3af5f781f/dm-exception-store.c/clean/drivers/md/dm-exception-store.c