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

ding.yemin at zte.com.cn ding.yemin at zte.com.cn
Mon Oct 31 02:03:15 UTC 2016


Hello Bart,

Thanks for your review. Using calloc() is really better than malloc(). I 
will modify and commit it later.

Thanks,

Ding Yemin.
 



Bart Van Assche <bart.vanassche at sandisk.com> 
2016-10-28 23:16

收件人
<ding.yemin at zte.com.cn>, Christophe Varoqui 
<christophe.varoqui at opensvc.com>, 
抄送
<tang.junhui at zte.com.cn>, <zhang.kai16 at zte.com.cn>, <dm-devel at redhat.com>
主题
Re: [dm-devel] [PATCH] Remove duplicated code in 
mpath_alloc_prin_response()






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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/dm-devel/attachments/20161031/a5f44d37/attachment.htm>


More information about the dm-devel mailing list