while (--i >= s) { class_device_unregister(&umad_dev->port[i - s].class_dev); class_device_unregister(&umad_dev->port[i - s].sm_class_dev); }
while (--i >= s) ib_umad_kill_port(&umad_dev->port[i]);
static void ib_umad_add_one(struct ib_device *device){	struct ib_umad_device *umad_dev;	int s, e, i;	if (device->node_type == IB_NODE_SWITCH)		s = e = 0;	else {		s = 1;		e = device->phys_port_cnt;	}	umad_dev = kzalloc(sizeof *umad_dev +			   (e - s + 1) * sizeof (struct ib_umad_port),			   GFP_KERNEL);	if (!umad_dev)		return;	kref_init(&umad_dev->ref);	umad_dev->start_port = s;	umad_dev->end_port   = e;	for (i = s; i <= e; ++i) {		umad_dev->port[i - s].umad_dev = umad_dev;		if (ib_umad_init_port(device, i, &umad_dev->port[i - s]))			goto err;	}	ib_set_client_data(device, &umad_client, umad_dev);	return;err:	while (--i >= s) {		class_device_unregister(&umad_dev->port[i - s].class_dev);		class_device_unregister(&umad_dev->port[i - s].sm_class_dev);	}	kref_put(&umad_dev->ref, ib_umad_release_dev);}