[openib-general] Re: [PATCH] ipoib_flush_paths

Michael S. Tsirkin mst at mellanox.co.il
Wed Apr 5 16:40:23 PDT 2006


Quoting r. Roland Dreier <rdreier at cisco.com>:
> It looks safe to ib_sa_cancel_query() with a stale or NULL query pointer.

I don't think so. Look into ib_sa_cancel_query:

void ib_sa_cancel_query(int id, struct ib_sa_query *query)
{
        unsigned long flags;
        struct ib_mad_agent *agent;
        struct ib_mad_send_buf *mad_buf;

        spin_lock_irqsave(&idr_lock, flags);
        if (idr_find(&query_idr, id) != query) {            <--------- !!!
                spin_unlock_irqrestore(&idr_lock, flags);
                return;
        }
        agent = query->port->agent;
        mad_buf = query->mad_buf;
        spin_unlock_irqrestore(&idr_lock, flags);

        ib_cancel_mad(agent, mad_buf);
}

See what happens if you pass a stale id (query finished) and a NULL query?

-- 
MST



More information about the general mailing list