From: Dan Carpenter <error27@gmail.com>
To: tariqt@nvidia.com
Cc: kernel-janitors@vger.kernel.org
Subject: [bug report] net/mlx5e: kTLS, Add debugfs
Date: Mon, 16 Jan 2023 13:06:44 +0300 [thread overview]
Message-ID: <Y8UhtLhI3fEeRA++@kili> (raw)
Hello Tariq Toukan,
The patch 0fedee1ae9ef: "net/mlx5e: kTLS, Add debugfs" from May 3,
2022, leads to the following Smatch static checker warning:
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c:897 mlx5e_tls_tx_debugfs_init()
warn: 'tls->debugfs.dfs_tx' is an error pointer or valid
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ktls_tx.c
890 static void mlx5e_tls_tx_debugfs_init(struct mlx5e_tls *tls,
891 struct dentry *dfs_root)
892 {
893 if (IS_ERR_OR_NULL(dfs_root))
894 return;
895
896 tls->debugfs.dfs_tx = debugfs_create_dir("tx", dfs_root);
--> 897 if (!tls->debugfs.dfs_tx)
This isn't NULL, but also the correct way to write debugsf code is to
delete the error checking. There are some exceptions where the driver
dereferences ->dfs_tx directly to get the inode size or whatever, but it
doesn't apply in this case.
898 return;
899
900 debugfs_create_size_t("pool_size", 0400, tls->debugfs.dfs_tx,
901 &tls->tx_pool->size);
902 }
regards,
dan carpenter
next reply other threads:[~2023-01-16 10:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-16 10:06 Dan Carpenter [this message]
2023-01-19 6:51 ` [bug report] net/mlx5e: kTLS, Add debugfs Tariq Toukan
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=Y8UhtLhI3fEeRA++@kili \
--to=error27@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=tariqt@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.