From: Bruce Richardson <bruce.richardson@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: <dev@dpdk.org>, Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [PATCH 1/4] net/ice: remove unnecessary null check
Date: Wed, 1 Apr 2026 17:44:00 +0100 [thread overview]
Message-ID: <ac1LUOvDJDAhZtnP@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <20260401164108.201404-2-stephen@networkplumber.org>
On Wed, Apr 01, 2026 at 09:40:22AM -0700, Stephen Hemminger wrote:
> No need to check for null before calling free.
> Found by coccinelle script null_free.
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> drivers/net/intel/ice/ice_dcf_sched.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
> diff --git a/drivers/net/intel/ice/ice_dcf_sched.c b/drivers/net/intel/ice/ice_dcf_sched.c
> index 948774a282..14e902edbe 100644
> --- a/drivers/net/intel/ice/ice_dcf_sched.c
> +++ b/drivers/net/intel/ice/ice_dcf_sched.c
> @@ -877,10 +877,8 @@ static int ice_dcf_hierarchy_commit(struct rte_eth_dev *dev,
> return ret_val;
>
> fail_clear:
> - if (vf_bw != NULL)
> - free(vf_bw);
> - if (tc_bw != NULL)
> - free(tc_bw);
> + free(vf_bw);
> + free(tc_bw);
>
> /* clear all the traffic manager configuration */
> if (clear_on_fail) {
> --
> 2.53.0
>
next prev parent reply other threads:[~2026-04-01 16:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-01 16:40 [PATCH 0/4] remove useless null checks before free Stephen Hemminger
2026-04-01 16:40 ` [PATCH 1/4] net/ice: remove unnecessary null check Stephen Hemminger
2026-04-01 16:44 ` Bruce Richardson [this message]
2026-04-01 16:40 ` [PATCH 2/4] net/bnxt: " Stephen Hemminger
2026-04-01 16:40 ` [PATCH 3/4] net/zxdh: " Stephen Hemminger
2026-04-01 16:40 ` [PATCH 4/4] app/test_compress: " Stephen Hemminger
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=ac1LUOvDJDAhZtnP@bricha3-mobl1.ger.corp.intel.com \
--to=bruce.richardson@intel.com \
--cc=anatoly.burakov@intel.com \
--cc=dev@dpdk.org \
--cc=stephen@networkplumber.org \
/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