rem: *_cookie = cookie;
add: if (status < B_OK) free(cookie); else *_cookie = cookie;
context: devfs_open(fs_volume _fs, fs_vnode _vnode, int openMode, fs_cookie *_cookie){	struct devfs_vnode *vnode = (struct devfs_vnode *)_vnode;	struct devfs_cookie *cookie;	status_t status = B_OK;	TRACE(("devfs_open: vnode %p, oflags 0x%x, fs_cookie %p \n", vnode, openMode, _cookie));	cookie = (struct devfs_cookie *)malloc(sizeof(struct devfs_cookie));	if (cookie == NULL)		return B_NO_MEMORY;	if (S_ISCHR(vnode->stream.type)) {		if (vnode->stream.u.dev.node != NULL) {			status = vnode->stream.u.dev.info->open(				vnode->stream.u.dev.node->parent->cookie, openMode,				&cookie->u.dev.dcookie);		} else {			char buffer[B_FILE_NAME_LENGTH];			get_device_name(vnode, buffer, sizeof(buffer));			status = vnode->stream.u.dev.ops->open(buffer, openMode,				&cookie->u.dev.dcookie);		}	}	*_cookie = cookie;	return status;}