[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6eac7fc4-9ade-41bb-a861-d7f339b388f6@web.de>
Date: Fri, 3 May 2024 09:30:33 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Duoming Zhou <duoming@....edu.cn>, linux-hams@...r.kernel.org,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Jörg Reuter
<jreuter@...na.de>, Paolo Abeni <pabeni@...hat.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
Dan Carpenter <dan.carpenter@...aro.org>,
Lars Kellogg-Stedman <lars@...bit.com>, Simon Horman <horms@...nel.org>
Subject: Re: [PATCH net v2 2/2] ax25: fix potential reference counting leak in
ax25_addr_ax25dev
How do you think about to append parentheses to the function name
in the summary phrase?
> The reference counting of ax25_dev potentially increase more
> than once in ax25_addr_ax25dev(), which will cause memory leak.
>
> In order to fix the above issue, only increase the reference
> counting of ax25_dev once, when the res is not null.
Would you find the following change description a bit nicer?
The reference counter of the object “ax25_dev” can be increased multiple times
in ax25_addr_ax25dev(). This will cause a memory leak so far.
Thus move a needed function call behind a for loop
and increase the reference counter only when the local variable “res”
is not a null pointer.
…
> +++ b/net/ax25/ax25_dev.c
> @@ -37,8 +37,9 @@ ax25_dev *ax25_addr_ax25dev(ax25_address *addr)
…
Would you like to omit curly brackets in the affected function implementation?
Regards,
Markus
Powered by blists - more mailing lists