From: Markus Elfring <Markus.Elfring@web.de>
To: Manuel Ebner <manuelebner@mailbox.org>,
intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Tony Nguyen <anthony.l.nguyen@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org,
Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Subject: Re: [PATCH net-next] i40e: Use common error handling code in i40e_register_auxiliary_dev()
Date: Wed, 10 Jun 2026 12:36:22 +0200 [thread overview]
Message-ID: <0789aef1-4173-40aa-94e7-576b73ad0201@web.de> (raw)
In-Reply-To: <c80c7ad9aa48dca8799ed2e76b1628aa7bec92b0.camel@mailbox.org>
>> +++ b/drivers/net/ethernet/intel/i40e/i40e_client.c
>> @@ -304,15 +304,15 @@ static int i40e_register_auxiliary_dev(struct i40e_info *ldev,
>> const char *name)
>> ldev->aux_dev = aux_dev;
>>
>> ret = ida_alloc(&i40e_client_ida, GFP_KERNEL);
>> - if (ret < 0) {
>> - kfree(i40e_aux_dev);
>> - return ret;
>> - }
>> + if (ret < 0)
>> + goto free_aux_dev;
>> +
>> aux_dev->id = ret;
>>
>> ret = auxiliary_device_init(aux_dev);
>> if (ret < 0) {
>> ida_free(&i40e_client_ida, aux_dev->id);
>> +free_aux_dev:
>> kfree(i40e_aux_dev);
>> return ret;
> why do you do this? There's no functional change, right?
> is it just readability?
Please take another look at corresponding information sources.
* Centralized exiting of functions
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.1-rc7#n526
* https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/recommendations/memory-management-mem/mem12-c/
Would you like to increase the application of scope-based resource management?
Regards,
Markus
next prev parent reply other threads:[~2026-06-10 10:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 8:20 Markus Elfring
2026-06-10 8:30 ` Manuel Ebner
2026-06-10 10:36 ` Markus Elfring [this message]
2026-06-10 9:12 ` [Intel-wired-lan] " Loktionov, Aleksandr
2026-06-11 9:13 ` Jagielski, Jedrzej
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=0789aef1-4173-40aa-94e7-576b73ad0201@web.de \
--to=markus.elfring@web.de \
--cc=aleksandr.loktionov@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manuelebner@mailbox.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=przemyslaw.kitszel@intel.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
all inboxes | Powered by JetHome®