Re: [PATCH v2] nbd: Fix memory leak in nbd_add_socket

From: Markus Elfring
Date: Mon Jun 22 2020 - 03:53:20 EST


>> 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