From: Dan Carpenter <dan.carpenter@linaro.org>
To: leon@kernel.org
Cc: linux-rdma@vger.kernel.org
Subject: [bug report] net/mlx5e: Generalize IPsec work structs
Date: Thu, 20 Apr 2023 11:24:09 +0300 [thread overview]
Message-ID: <9ef32c2b-8e07-486b-af8d-9d332d5426ab@kili.mountain> (raw)
Hello Leon Romanovsky,
This is a semi-automatic email about new static checker warnings.
The patch 4562116f8a56: "net/mlx5e: Generalize IPsec work structs"
from Mar 30, 2023, leads to the following Smatch complaint:
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c:755 mlx5e_xfrm_free_state()
error: we previously assumed 'sa_entry->work' could be null (see line 746)
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
745
746 if (sa_entry->work)
^^^^^^^^^^^^^^
747 cancel_work_sync(&sa_entry->work->work);
748
749 if (sa_entry->dwork)
^^^^^^^^^^^^^^^
These checks can be deleted, right?
750 cancel_delayed_work_sync(&sa_entry->dwork->dwork);
751
752 mlx5e_accel_ipsec_fs_del_rule(sa_entry);
753 mlx5_ipsec_free_sa_ctx(sa_entry);
754 kfree(sa_entry->dwork);
755 kfree(sa_entry->work->data);
^^^^^^^^^^^^^^^^^^^^
Unchecked dereference.
756 kfree(sa_entry->work);
757 sa_entry_free:
regards,
dan carpenter
next reply other threads:[~2023-04-20 8:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-20 8:24 Dan Carpenter [this message]
2023-04-23 13:24 ` [bug report] net/mlx5e: Generalize IPsec work structs Leon Romanovsky
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=9ef32c2b-8e07-486b-af8d-9d332d5426ab@kili.mountain \
--to=dan.carpenter@linaro.org \
--cc=leon@kernel.org \
--cc=linux-rdma@vger.kernel.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