Re: [PATCH 13/15] ib_srp: Allow SRP disconnect through sysfs

Mike Christie
2012-07-16T22:20:36Z

On 03/25/2012 09:01 AM, Bart Van Assche wrote:
> +static void srp_rport_delete(struct srp_rport *rport)
> +{
> + struct srp_target_port *target = rport->lld_data;
> +
> + BUG_ON(!target);
> +

I don't think this null check is needed, because below you set the
lld_data before you call srp_rport_add which does the transport driver
model/sysfs file addition for the rport. So I think the rport delete
sysfs file won't show up before you set the lld_data.

> static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
> {
> struct srp_rport_identifiers ids;
> @@ -2002,6 +2021,8 @@ static int srp_add_target(struct srp_host *host, struct srp_target_port *target)
> return PTR_ERR(rport);
> }
>
> + rport->lld_data = target;
> +