From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: oe-kbuild@lists.linux.dev, lkp@intel.com,
oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: drivers/thunderbolt/tmu.c:617 tb_switch_tmu_change_mode() warn: missing unwind goto?
Date: Fri, 3 Nov 2023 13:48:02 +0200 [thread overview]
Message-ID: <20231103114802.GQ17433@black.fi.intel.com> (raw)
In-Reply-To: <9a426df0-2ad2-48e7-aa6a-21e5c40ec839@kadam.mountain>
Hi Dan,
On Fri, Nov 03, 2023 at 09:01:34AM +0300, Dan Carpenter wrote:
> Hi Mika,
>
> FYI, the error/warning was bisected to this commit, please ignore it if it's irrelevant.
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 4652b8e4f3ffa48c706ec334f048c217a7d9750d
> commit: c437dcb18310f296eb9db58a361f309f7817014d thunderbolt: Fix a couple of style issues in TMU code
> config: i386-randconfig-141-20231102 (https://download.01.org/0day-ci/archive/20231103/202311030814.AXtCk7PO-lkp@intel.com/config)
> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce: (https://download.01.org/0day-ci/archive/20231103/202311030814.AXtCk7PO-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202311030814.AXtCk7PO-lkp@intel.com/
>
> smatch warnings:
> drivers/thunderbolt/tmu.c:617 tb_switch_tmu_change_mode() warn: missing unwind goto?
>
> vim +617 drivers/thunderbolt/tmu.c
>
> c437dcb18310f2 Mika Westerberg 2022-10-07 596 static int tb_switch_tmu_change_mode(struct tb_switch *sw)
> b017a46d486cd4 Gil Fine 2022-05-26 597 {
> b017a46d486cd4 Gil Fine 2022-05-26 598 struct tb_port *up, *down;
> b017a46d486cd4 Gil Fine 2022-05-26 599 int ret;
> b017a46d486cd4 Gil Fine 2022-05-26 600
> b017a46d486cd4 Gil Fine 2022-05-26 601 up = tb_upstream_port(sw);
> 7ce542219b6323 Gil Fine 2022-09-23 602 down = tb_switch_downstream_port(sw);
> b017a46d486cd4 Gil Fine 2022-05-26 603 ret = tb_port_tmu_set_unidirectional(down, sw->tmu.unidirectional_request);
> b017a46d486cd4 Gil Fine 2022-05-26 604 if (ret)
> b017a46d486cd4 Gil Fine 2022-05-26 605 goto out;
> b017a46d486cd4 Gil Fine 2022-05-26 606
> b017a46d486cd4 Gil Fine 2022-05-26 607 if (sw->tmu.unidirectional_request)
> 7ce542219b6323 Gil Fine 2022-09-23 608 ret = tb_switch_tmu_rate_write(tb_switch_parent(sw),
> 7ce542219b6323 Gil Fine 2022-09-23 609 sw->tmu.rate_request);
> b017a46d486cd4 Gil Fine 2022-05-26 610 else
> b017a46d486cd4 Gil Fine 2022-05-26 611 ret = tb_switch_tmu_rate_write(sw, sw->tmu.rate_request);
> b017a46d486cd4 Gil Fine 2022-05-26 612 if (ret)
> b017a46d486cd4 Gil Fine 2022-05-26 613 return ret;
>
> These error paths should be goto out;
>
> b017a46d486cd4 Gil Fine 2022-05-26 614
> b017a46d486cd4 Gil Fine 2022-05-26 615 ret = tb_switch_set_tmu_mode_params(sw, sw->tmu.rate_request);
> b017a46d486cd4 Gil Fine 2022-05-26 616 if (ret)
> b017a46d486cd4 Gil Fine 2022-05-26 @617 return ret;
>
> Same. (I guess before goto out was a do-nothing goto so it didn't
> matter).
Thanks for the report!
This code is different now in the mainline but this one is still there
and I agree it should goto out.
I will send a fix after -rc1 is released.
prev parent reply other threads:[~2023-11-03 11:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 6:01 Dan Carpenter
2023-11-03 11:48 ` Mika Westerberg [this message]
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=20231103114802.GQ17433@black.fi.intel.com \
--to=mika.westerberg@linux.intel.com \
--cc=dan.carpenter@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=oe-kbuild@lists.linux.dev \
/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
all inboxes | Powered by JetHome®