From: Dan Carpenter <dan.carpenter@oracle.com>
To: Meng Tang <tangmeng@uniontech.com>
Cc: t.sailer@alumni.ethz.ch, davem@davemloft.net, kuba@kernel.org,
linux-hams@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] hamradio: Fix wrong assignment of 'bbc->cfg.loopback'
Date: Tue, 15 Mar 2022 14:55:36 +0300 [thread overview]
Message-ID: <20220315115536.GN3293@kadam> (raw)
In-Reply-To: <20220315074851.6456-1-tangmeng@uniontech.com>
On Tue, Mar 15, 2022 at 03:48:51PM +0800, Meng Tang wrote:
> In file hamradio/baycom_epp.c, the baycom_setmode interface, there
> is a problem with improper use of strstr.
>
> Suppose that when modestr="noloopback", both conditions which are
> 'strstr(modestr,"noloopback")' and 'strstr(modestr,"loopback")'
> will be true(not NULL), this lead the bc->cfg.loopback variable
> will be first assigned to 0, and then reassigned to 1.
>
> This will cause 'bc->cfg.loopback = 0' will never take effect. That
> obviously violates the logic of the code, so adjust the order of
> their execution to solve the problem.
>
> Signed-off-by: Meng Tang <tangmeng@uniontech.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
This bug predates git. :P Did you find it by testing or reviewing the
code?
regards,
dan carpenter
next prev parent reply other threads:[~2022-03-15 11:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 7:48 [PATCH] hamradio: Fix wrong assignment of 'bbc->cfg.loopback' Meng Tang
2022-03-15 11:55 ` Dan Carpenter [this message]
2022-03-17 2:30 ` patchwork-bot+netdevbpf
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=20220315115536.GN3293@kadam \
--to=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-hams@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=t.sailer@alumni.ethz.ch \
--cc=tangmeng@uniontech.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 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).