[ofw] [IBAL]Patch protect from possible null dereference.
Yossi Leybovich
sleybo at mellanox.co.il
Thu Apr 5 06:05:19 PDT 2007
More over
If are heading to the complete solution we also need a lock to sync
between setting of the flags and the checks.
In you patch there is still window that can cause the flags checks to
pass although the device is removed.
What do you think ?
Did you find scenario that cause to this race ? Does the your solution
helps ?
I also notice that few function in bus_iou_mgr checks the present flag
while the function in bus_port_mgr don't.
Thanks
Yossi
-----Original Message-----
From: Alex Estrin [mailto:alex.estrin at qlogic.com]
Sent: Thursday, April 05, 2007 3:57 PM
To: Yossi Leybovich; ofw at lists.openfabrics.org
Subject: RE: [ofw] [IBAL]Patch protect from possible null dereference.
Yes, I think you are right.
Thanks,
Alex
> -----Original Message-----
> From: Yossi Leybovich [mailto:sleybo at dev.mellanox.co.il]
> Sent: Thursday, April 05, 2007 4:10 AM
> To: Alex Estrin; Yossi Leybovich; ofw at lists.openfabrics.org
> Subject: RE: [ofw] [IBAL]Patch protect from possible null dereference.
>
> Hi
>
> Thanks for the patch , I think we need to do the same for the
bus_port_mgr
> ?
> What do you think?
>
> Yossi
>
> > -----Original Message-----
> > From: ofw-bounces at lists.openfabrics.org
> > [mailto:ofw-bounces at lists.openfabrics.org] On Behalf Of Alex Estrin
> > Sent: Wednesday, April 04, 2007 10:53 PM
> > To: Yossi Leybovich; ofw at lists.openfabrics.org
> > Subject: [ofw] [IBAL]Patch protect from possible null dereference.
> >
> > Yossi,
> >
> > Proposed patch is to verify device status flags before dereferencing
> > hca. This could be the case if IOU goes away before it had a chance
> > to complete initialization.
> > Please review.
> >
> > Thanks,
> > Alex
> >
> >
> >
> > Index: bus_iou_mgr.c
> > ===================================================================
> > --- bus_iou_mgr.c (revision 623)
> > +++ bus_iou_mgr.c (working copy)
> > @@ -1370,6 +1370,14 @@
> > &GUID_BUS_INTERFACE_STANDARD ) )
> > {
> > p_ext = p_dev_obj->DeviceExtension;
> > +
> > + if( !p_ext->h_ca ||
> > + !p_ext->b_present ||
> > + p_ext->b_reported_missing )
> > + {
> > + return STATUS_NO_SUCH_DEVICE;
> > + }
> > +
> > status = cl_fwd_query_ifc(
> > p_ext->h_ca->obj.p_ci_ca->verbs.p_hca_dev,
> > p_io_stack );
> > }
> >
More information about the ofw
mailing list