[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <46ee9dd9-4895-80a2-a846-6444a72a15c2@intel.com>
Date: Wed, 11 Jan 2023 11:31:55 -0800
From: Tony Nguyen <anthony.l.nguyen@...el.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: <davem@...emloft.net>, <pabeni@...hat.com>, <edumazet@...gle.com>,
Jiasheng Jiang <jiasheng@...as.ac.cn>,
<netdev@...r.kernel.org>, Jiri Pirko <jiri@...dia.com>,
Gurucharan G <gurucharanx.g@...el.com>
Subject: Re: [PATCH net 2/2] ice: Add check for kzalloc
On 1/10/2023 6:26 PM, Jakub Kicinski wrote:
> On Mon, 9 Jan 2023 14:53:58 -0800 Tony Nguyen wrote:
>> @@ -470,21 +473,23 @@ static struct tty_driver *ice_gnss_create_tty_driver(struct ice_pf *pf)
>> err = tty_register_driver(tty_driver);
>> if (err) {
>> dev_err(dev, "Failed to register TTY driver err=%d\n", err);
>> -
>> - for (i = 0; i < ICE_GNSS_TTY_MINOR_DEVICES; i++) {
>> - tty_port_destroy(pf->gnss_tty_port[i]);
>> - kfree(pf->gnss_tty_port[i]);
>> - }
>> - kfree(ttydrv_name);
>> - tty_driver_kref_put(pf->ice_gnss_tty_driver);
>> -
>> - return NULL;
>> + goto err_out;
>
> FTR I think that depending on i == ICE_GNSS_TTY_MINOR_DEVICES
> here is fragile. I can merge as is, since the code is technically
> correct
Hi Jakub,
Thanks for the suggestion/improvement. This won't be here much longer as
we will be converting to use the kernel infrastructure [1] soon, but
will keep this in mind for the future.
This was mainly to ensure the existing implementations got
corrected/could be backported.
Thanks,
Tony
[1]
https://lore.kernel.org/netdev/20221215231047.3595649-1-anthony.l.nguyen@intel.com/
Powered by blists - more mailing lists