All of lore.kernel.org
 help / color / mirror / Atom feed
From: ding.yemin@zte.com.cn
To: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: dm-devel@redhat.com, tang.junhui@zte.com.cn, zhang.kai16@zte.com.cn
Subject: Re: [PATCH] Remove duplicated code in mpath_alloc_prin_response()
Date: Mon, 31 Oct 2016 10:03:15 +0800	[thread overview]
Message-ID: <OF4A4409C2.FCA3FBAE-ON4825805D.000B23A2-4825805D.000B4C6F@zte.com.cn> (raw)
In-Reply-To: <4109416b-9d3c-9b31-90bc-1f8695d9aca9@sandisk.com>


[-- Attachment #1.1: Type: text/plain, Size: 1015 bytes --]

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@sandisk.com> 
2016-10-28 23:16

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






On 10/25/2016 01:19 AM, ding.yemin@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.




[-- Attachment #1.2: Type: text/html, Size: 2772 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2016-10-31  2:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-25  8:19 [PATCH] Remove duplicated code in mpath_alloc_prin_response() ding.yemin
2016-10-28 15:16 ` Bart Van Assche
2016-10-31  2:03   ` ding.yemin [this message]
2016-10-31  2:55 ding.yemin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF4A4409C2.FCA3FBAE-ON4825805D.000B23A2-4825805D.000B4C6F@zte.com.cn \
    --to=ding.yemin@zte.com.cn \
    --cc=bart.vanassche@sandisk.com \
    --cc=dm-devel@redhat.com \
    --cc=tang.junhui@zte.com.cn \
    --cc=zhang.kai16@zte.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.