[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y5HH54ek3KX2aHpI@nanopsycho>
Date: Thu, 8 Dec 2022 12:17:59 +0100
From: Jiri Pirko <jiri@...nulli.us>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>
Cc: leon@...nel.org, jesse.brandeburg@...el.com,
anthony.l.nguyen@...el.com, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
intel-wired-lan@...ts.osuosl.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH net v2] ice: Add check for kzalloc
Thu, Dec 08, 2022 at 11:06:03AM CET, jiasheng@...as.ac.cn wrote:
>On Thu, Dec 08, 2022 at 05:25:02PM +0800, Leon Romanovsky wrote:
>>> +err_out:
>>> + for (j = 0; j < i; j++) {
>>
>> You don't need an extra variable, "while(i--)" will do the trick.
>
>No, the right range is [0, i - 1], but the "while(i--)" is [1, i].
Are you sure??
>If using "while(i--)", the code should be "tty_port_destroy(pf->gnss_tty_port[i - 1]);".
>It will be more complex.
>Therefore, it is worthwhile to use an extra varaible.
>
>Thanks,
>Jiang
>
Powered by blists - more mailing lists