All of lore.kernel.org
 help / color / mirror / Atom feed
* [bug report] net/mlx5e: kTLS, Add debugfs
@ 2023-01-16 10:06 Dan Carpenter
  2023-01-19  6:51 ` Tariq Toukan
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2023-01-16 10:06 UTC (permalink / raw)
  To: tariqt; +Cc: kernel-janitors

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [bug report] net/mlx5e: kTLS, Add debugfs
  2023-01-16 10:06 [bug report] net/mlx5e: kTLS, Add debugfs Dan Carpenter
@ 2023-01-19  6:51 ` Tariq Toukan
  0 siblings, 0 replies; 2+ messages in thread
From: Tariq Toukan @ 2023-01-19  6:51 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: kernel-janitors, Gal Pressman, tariq Toukan



On 16/01/2023 12:06, Dan Carpenter wrote:
> 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

Hi Dan,

Thanks for your report.
We'll analyze and handle soon.

Regards,
Tariq

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-19  6:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-16 10:06 [bug report] net/mlx5e: kTLS, Add debugfs Dan Carpenter
2023-01-19  6:51 ` Tariq Toukan

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.