lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <9a426df0-2ad2-48e7-aa6a-21e5c40ec839@kadam.mountain>
Date:   Fri, 3 Nov 2023 09:01:34 +0300
From:   Dan Carpenter <dan.carpenter@...aro.org>
To:     oe-kbuild@...ts.linux.dev,
        Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     lkp@...el.com, oe-kbuild-all@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: drivers/thunderbolt/tmu.c:617 tb_switch_tmu_change_mode() warn:
 missing unwind goto?

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@...el.com>
| Reported-by: Dan Carpenter <dan.carpenter@...aro.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).

b017a46d486cd4 Gil Fine        2022-05-26  618  
b017a46d486cd4 Gil Fine        2022-05-26  619  	ret = tb_port_tmu_set_unidirectional(up, sw->tmu.unidirectional_request);
b017a46d486cd4 Gil Fine        2022-05-26  620  	if (ret)
b017a46d486cd4 Gil Fine        2022-05-26  621  		goto out;
b017a46d486cd4 Gil Fine        2022-05-26  622  
b017a46d486cd4 Gil Fine        2022-05-26  623  	ret = tb_port_tmu_time_sync_enable(down);
b017a46d486cd4 Gil Fine        2022-05-26  624  	if (ret)
b017a46d486cd4 Gil Fine        2022-05-26  625  		goto out;
b017a46d486cd4 Gil Fine        2022-05-26  626  
b017a46d486cd4 Gil Fine        2022-05-26  627  	ret = tb_port_tmu_time_sync_enable(up);
b017a46d486cd4 Gil Fine        2022-05-26  628  	if (ret)
b017a46d486cd4 Gil Fine        2022-05-26  629  		goto out;
b017a46d486cd4 Gil Fine        2022-05-26  630  
b017a46d486cd4 Gil Fine        2022-05-26  631  	return 0;
b017a46d486cd4 Gil Fine        2022-05-26  632  
b017a46d486cd4 Gil Fine        2022-05-26  633  out:
c437dcb18310f2 Mika Westerberg 2022-10-07  634  	tb_switch_tmu_change_mode_prev(sw);
b017a46d486cd4 Gil Fine        2022-05-26  635  	return ret;
b017a46d486cd4 Gil Fine        2022-05-26  636  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ