[ofw] [IBAL]Patch protect from possible null dereference.

Yossi Leybovich sleybo at dev.mellanox.co.il
Thu Apr 5 01:10:13 PDT 2007


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