[ofa-general] [PATCH 1/1] SDP - Fix reference count bug that prevents mlx4_ib and ib_sdp unload

Sean Hefty mshefty at ichips.intel.com
Tue Nov 6 07:50:52 PST 2007


>  static void sdp_remove_device(struct ib_device *device)
>  {
> +       struct list_head *p;
> +       struct sdp_sock  *ssk;
> +       struct sock      *sk;
> +
>         write_lock(&device_removal_lock);
> +
> +       spin_lock_irq(&sock_list_lock);
> +       list_for_each(p, &sock_list) {
> +               ssk = list_entry(p, struct sdp_sock, sock_list);
> +               if (ssk->ib_device == device) {
> +                       sk = &ssk->isk.sk;
> +
> +                       if (ssk->id) {
> +                               rdma_destroy_id(ssk->id);

This is a blocking call, and a spin lock is being held.

> +                               ssk->id = NULL;
> +                       }
> +
> +                       sk->sk_shutdown |= RCV_SHUTDOWN;
> +                       sdp_reset(sk);
> +               }
> +       }
> +       spin_unlock_irq(&sock_list_lock);
> +
>         write_unlock(&device_removal_lock);
>  }

- Sean



More information about the general mailing list