[Openib-windows] [PTACH] ib_dereg_svc func when registration failed
Yossi Leybovich
sleybo at mellanox.co.il
Sun Sep 10 06:46:08 PDT 2006
Fab
In case that a user call ib_reg_svc but the registration failed (invalid
port), call to ib_dereg_svc will cause ibal to stuck in endless loop.
That because ib_dereg_svc check that the handle is not NULL and try to
destroy the obj by deref the al obj.
In the case that the ib_reg_svc did not succeed ibal will destroy the
reg_svc obj before ib_reg_svc return.
So another call to ib_dereg_svc will cause ibal to try deref obj that
was already destroyed.
This patch fix the problem
10x
Yossi
Singed-off-by: Yossi Leybovich (sleybo at mellanoc.co.il)
Index: al_reg_svc.c
===================================================================
--- al_reg_svc.c (revision 1658)
+++ al_reg_svc.c (working copy)
@@ -344,12 +344,13 @@
{
AL_ENTER( AL_DBG_SA_REQ );
- if( !h_reg_svc )
+
+ if( AL_OBJ_INVALID_HANDLE( h_reg_svc, AL_OBJ_TYPE_H_SA_REG) )
{
- AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
("IB_INVALID_HANDLE\n") );
+ AL_PRINT_EXIT( TRACE_LEVEL_ERROR, AL_DBG_ERROR,
("AL_OBJ_TYPE_H_SA_REG\n") );
return IB_INVALID_HANDLE;
}
-
+
ref_al_obj( &h_reg_svc->obj );
h_reg_svc->obj.pfn_destroy( &h_reg_svc->obj, pfn_destroy_cb );
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dereg_svc.patch
Type: application/octet-stream
Size: 616 bytes
Desc: dereg_svc.patch
URL: <http://lists.openfabrics.org/pipermail/ofw/attachments/20060910/f3409f63/attachment.obj>
More information about the ofw
mailing list