On 4/5/23 21:25, Saravanan Vajravel wrote:
+ if (IS_ERR(mad_agent)) { pr_err("%s-%d: MAD agent registration failed (%ld). Note: this is expected if SR-IOV is enabled.\n", dev_name(&sport->sdev->device->dev), sport->port, - PTR_ERR(sport->mad_agent)); + PTR_ERR(mad_agent)); sport->mad_agent = NULL; memset(&port_modify, 0, sizeof(port_modify)); port_modify.clr_port_cap_mask = IB_PORT_DEVICE_MGMT_SUP; ib_modify_port(sport->sdev->device, sport->port, 0, &port_modify); - + } else { + sport->mad_agent = mad_agent; } }
With an early return the 'else' clause wouldn't have been necessary. Anyway: Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>