All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@linaro.org>
To: Lance Yang <lance.yang@linux.dev>
Cc: netfilter-devel@vger.kernel.org
Subject: [bug report] netfilter: load nf_log_syslog on enabling nf_conntrack_log_invalid
Date: Mon, 4 Aug 2025 11:21:58 +0300	[thread overview]
Message-ID: <aJBtpniVz8dIRDYf@stanley.mountain> (raw)

Hello Lance Yang,

Commit e89a68046687 ("netfilter: load nf_log_syslog on enabling
nf_conntrack_log_invalid") from May 26, 2025 (linux-next), leads to
the following Smatch static checker warning:

	net/netfilter/nf_conntrack_standalone.c:575 nf_conntrack_log_invalid_sysctl()
	warn: missing error code? 'ret'

net/netfilter/nf_conntrack_standalone.c
    559 static int
    560 nf_conntrack_log_invalid_sysctl(const struct ctl_table *table, int write,
    561                                 void *buffer, size_t *lenp, loff_t *ppos)
    562 {
    563         int ret, i;
    564 
    565         ret = proc_dou8vec_minmax(table, write, buffer, lenp, ppos);
    566         if (ret < 0 || !write)
    567                 return ret;
    568 
    569         if (*(u8 *)table->data == 0)
    570                 return ret;

return 0?

    571 
    572         /* Load nf_log_syslog only if no logger is currently registered */
    573         for (i = 0; i < NFPROTO_NUMPROTO; i++) {
    574                 if (nf_log_is_registered(i))
--> 575                         return ret;

This feels like it should be return -EBUSY?  Or potentially return 0.

    576         }
    577         request_module("%s", "nf_log_syslog");
    578 
    579         return ret;

return 0.

    580 }

regards,
dan carpenter

             reply	other threads:[~2025-08-04  8:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04  8:21 Dan Carpenter [this message]
2025-08-04  9:05 ` [bug report] netfilter: load nf_log_syslog on enabling nf_conntrack_log_invalid Lance Yang
2025-08-04  9:24   ` Dan Carpenter
2025-08-04  9:57     ` Lance Yang
2025-08-04 10:04       ` Lance Yang
2025-08-04 10:10       ` Dan Carpenter
2025-08-04 10:24         ` Lance Yang

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=aJBtpniVz8dIRDYf@stanley.mountain \
    --to=dan.carpenter@linaro.org \
    --cc=lance.yang@linux.dev \
    --cc=netfilter-devel@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 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.