[openib-general] [PATCH] libibverbs: should not access NULL pointer.

Michael S. Tsirkin mst at mellanox.co.il
Mon Jan 22 21:41:44 PST 2007


> Quoting Krishna Kumar <krkumar2 at in.ibm.com>:
> Subject: [PATCH] libibverbs: should not access NULL pointer.
> 
> diff -ruNp org/libibverbs/src/device.c new/libibverbs/src/device.c
> --- org/libibverbs/src/device.c	2007-01-16 09:11:33.000000000 +0530
> +++ new/libibverbs/src/device.c	2007-01-23 10:57:46.000000000 +0530
> @@ -63,8 +63,10 @@ struct ibv_device **ibv_get_device_list(
>  		num_devices = ibverbs_init(&device_list);
>  
>  	l = calloc(num_devices + 1, sizeof (struct ibv_device *));

BTW, Roland,
   	l = calloc(num_devices + 1, sizeof *l);
would be a bit prettier, would it not?

-- 
MST




More information about the general mailing list