if (down_interruptible(&port->sm_sem)) return -ERESTARTSYS;
if (down_interruptible(&port->sm_sem)) { ret = -ERESTARTSYS; goto fail; }
static int ib_umad_sm_open(struct inode *inode, struct file *filp){	struct ib_umad_port *port =		container_of(inode->i_cdev, struct ib_umad_port, sm_dev);	struct ib_port_modify props = {		.set_port_cap_mask = IB_PORT_SM	};	int ret;	if (filp->f_flags & O_NONBLOCK) {		if (down_trylock(&port->sm_sem))			return -EAGAIN;	} else {		if (down_interruptible(&port->sm_sem))			return -ERESTARTSYS;	}	ret = ib_modify_port(port->ib_dev, port->port_num, 0, &props);	if (ret) {		up(&port->sm_sem);		return ret;	}	filp->private_data = port;	return 0;}