netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] netfilter: conntrack: Convert to use ERR_CAST()
@ 2024-08-28 11:06 Shen Lichuan
  2024-09-03  8:43 ` Pablo Neira Ayuso
  0 siblings, 1 reply; 2+ messages in thread
From: Shen Lichuan @ 2024-08-28 11:06 UTC (permalink / raw)
  To: pablo, kadlec, davem, edumazet, kuba, pabeni
  Cc: netfilter-devel, coreteam, netdev, linux-kernel,
	opensource.kernel, Shen Lichuan

Use the ERR_CAST macro to clearly indicate that this is a pointer 
to an error value and that a type conversion was performed.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
---
 net/netfilter/nf_conntrack_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c
index 9384426ddc06..d3cb53b008f5 100644
--- a/net/netfilter/nf_conntrack_core.c
+++ b/net/netfilter/nf_conntrack_core.c
@@ -1722,7 +1722,7 @@ init_conntrack(struct net *net, struct nf_conn *tmpl,
 	ct = __nf_conntrack_alloc(net, zone, tuple, &repl_tuple, GFP_ATOMIC,
 				  hash);
 	if (IS_ERR(ct))
-		return (struct nf_conntrack_tuple_hash *)ct;
+		return ERR_CAST(ct);
 
 	if (!nf_ct_add_synproxy(ct, tmpl)) {
 		nf_conntrack_free(ct);
-- 
2.17.1


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

* Re: [PATCH v1] netfilter: conntrack: Convert to use ERR_CAST()
  2024-08-28 11:06 [PATCH v1] netfilter: conntrack: Convert to use ERR_CAST() Shen Lichuan
@ 2024-09-03  8:43 ` Pablo Neira Ayuso
  0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2024-09-03  8:43 UTC (permalink / raw)
  To: Shen Lichuan
  Cc: kadlec, davem, edumazet, kuba, pabeni, netfilter-devel, coreteam,
	netdev, linux-kernel, opensource.kernel

On Wed, Aug 28, 2024 at 07:06:51PM +0800, Shen Lichuan wrote:
> Use the ERR_CAST macro to clearly indicate that this is a pointer 
> to an error value and that a type conversion was performed.

Applied, thanks

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

end of thread, other threads:[~2024-09-03  8:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-28 11:06 [PATCH v1] netfilter: conntrack: Convert to use ERR_CAST() Shen Lichuan
2024-09-03  8:43 ` Pablo Neira Ayuso

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).