kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Zheng Bin <zhengbin13@huawei.com>, linux-block@vger.kernel.org
Cc: nbd@other.debian.org, Aditya Pakki <pakki001@umn.edu>,
	Navid Emamdoost <emamd001@umn.edu>, Kangjie Lu <kjlu@umn.edu>,
	Stephen McCamant <mccamant@cs.umn.edu>,
	Qiushi Wu <wu000273@umn.edu>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jens Axboe <axboe@kernel.dk>, Josef Bacik <josef@toxicpanda.com>,
	Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
	Yi Zhang <yi.zhang@huawei.com>
Subject: Re: [PATCH v2] nbd: Fix memory leak in nbd_add_socket
Date: Mon, 22 Jun 2020 07:52:22 +0000	[thread overview]
Message-ID: <1a58ab81-3810-0763-7394-10b51add23ee@web.de> (raw)
In-Reply-To: <db17d022-a53a-3781-63d4-c38d5cf5b1e4@huawei.com>

>> Can an other wording variant be nicer?
>
> em, how about this?
>
>
> When adding first socket to nbd,

How do you think about to replace abbreviations by terms?


> if nsock's allocation fails,

… failed,


> config->socks is malloced

The data structure member “config->socks” was reallocated.


> but num_connections does not update,

But the data structure member “config->num_connections” was not updated.


> memory leak will occur(Function
> nbd_config_put will only free config->socks when num_connections is not 0).

A memory leak will occur then because the function “nbd_config_put”
will free “config->socks” only when “num_connections” is not zero.

Would you like to add an imperative wording to the commit message?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id=625d3449788f85569096780592549d0340e9c0c7#n151

Regards,
Markus

      reply	other threads:[~2020-06-22  7:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-20 12:05 [PATCH v2] nbd: Fix memory leak in nbd_add_socket Markus Elfring
2020-06-22  3:25 ` Zhengbin (OSKernel)
2020-06-22  7:52   ` Markus Elfring [this message]

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=1a58ab81-3810-0763-7394-10b51add23ee@web.de \
    --to=markus.elfring@web.de \
    --cc=axboe@kernel.dk \
    --cc=emamd001@umn.edu \
    --cc=josef@toxicpanda.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kjlu@umn.edu \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mccamant@cs.umn.edu \
    --cc=nbd@other.debian.org \
    --cc=pakki001@umn.edu \
    --cc=tuomas.tynkkynen@iki.fi \
    --cc=wu000273@umn.edu \
    --cc=yi.zhang@huawei.com \
    --cc=zhengbin13@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).