[dm-devel] [PATCH] Remove duplicated code in mpath_alloc_prin_response()

Bart Van Assche bart.vanassche at sandisk.com
Fri Oct 28 15:16:18 UTC 2016


On 10/25/2016 01:19 AM, ding.yemin at zte.com.cn wrote:
>  	}
> +	if (size > 0)
> +	{
> +		ptr = malloc(size);
> +		if (ptr)
> +		{
> +			memset(ptr, 0, size);
> +		}
> +	}
>  	return ptr;
>  }

Hello Ding Yemin,

Please use calloc() instead of open coding it.

Thanks,

Bart.




More information about the dm-devel mailing list