* [cip:linux-4.19.y-cip-rebase 576/965] drivers/usb/typec/mux.c:169 typec_mux_match() warn: missing unwind goto?
@ 2024-09-27 12:59 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-09-27 12:59 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/cip/linux-cip.git linux-4.19.y-cip-rebase
head: 43848671a69f7ed12a877f0249e0e1b1a1628066
commit: 61703341348288c799c78660d36d1ddabad29ccc [576/965] usb: typec: mux: Fix unsigned comparison with less than zero
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: i386-randconfig-141-20240927 (https://download.01.org/0day-ci/archive/20240927/202409272010.RJVqF8In-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
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 <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202409272010.RJVqF8In-lkp@intel.com/
smatch warnings:
drivers/usb/typec/mux.c:169 typec_mux_match() warn: missing unwind goto?
vim +169 drivers/usb/typec/mux.c
bdecb33af34f79 Heikki Krogerus 2018-03-20 124
bdecb33af34f79 Heikki Krogerus 2018-03-20 125 static void *typec_mux_match(struct device_connection *con, int ep, void *data)
bdecb33af34f79 Heikki Krogerus 2018-03-20 126 {
4c4129e8af94c1 Heikki Krogerus 2020-02-21 127 const struct typec_altmode_desc *desc = data;
bdecb33af34f79 Heikki Krogerus 2018-03-20 128 struct typec_mux *mux;
61703341348288 YueHaibing 2020-02-21 129 int nval;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 130 bool match;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 131 u16 *val;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 132 int i;
bdecb33af34f79 Heikki Krogerus 2018-03-20 133
4c4129e8af94c1 Heikki Krogerus 2020-02-21 134 if (!con->fwnode) {
bdecb33af34f79 Heikki Krogerus 2018-03-20 135 list_for_each_entry(mux, &mux_list, entry)
bdecb33af34f79 Heikki Krogerus 2018-03-20 136 if (!strcmp(con->endpoint[ep], dev_name(mux->dev)))
bdecb33af34f79 Heikki Krogerus 2018-03-20 137 return mux;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 138 return ERR_PTR(-EPROBE_DEFER);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 139 }
bdecb33af34f79 Heikki Krogerus 2018-03-20 140
bdecb33af34f79 Heikki Krogerus 2018-03-20 141 /*
4c4129e8af94c1 Heikki Krogerus 2020-02-21 142 * Check has the identifier already been "consumed". If it
4c4129e8af94c1 Heikki Krogerus 2020-02-21 143 * has, no need to do any extra connection identification.
bdecb33af34f79 Heikki Krogerus 2018-03-20 144 */
4c4129e8af94c1 Heikki Krogerus 2020-02-21 145 match = !con->id;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 146 if (match)
4c4129e8af94c1 Heikki Krogerus 2020-02-21 147 goto find_mux;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 148
4c4129e8af94c1 Heikki Krogerus 2020-02-21 149 /* Accessory Mode muxes */
4c4129e8af94c1 Heikki Krogerus 2020-02-21 150 if (!desc) {
4c4129e8af94c1 Heikki Krogerus 2020-02-21 151 match = fwnode_property_present(con->fwnode, "accessory");
4c4129e8af94c1 Heikki Krogerus 2020-02-21 152 if (match)
4c4129e8af94c1 Heikki Krogerus 2020-02-21 153 goto find_mux;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 154 return NULL;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 155 }
4c4129e8af94c1 Heikki Krogerus 2020-02-21 156
4c4129e8af94c1 Heikki Krogerus 2020-02-21 157 /* Alternate Mode muxes */
4c4129e8af94c1 Heikki Krogerus 2020-02-21 158 nval = fwnode_property_read_u16_array(con->fwnode, "svid", NULL, 0);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 159 if (nval <= 0)
4c4129e8af94c1 Heikki Krogerus 2020-02-21 160 return NULL;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 161
4c4129e8af94c1 Heikki Krogerus 2020-02-21 162 val = kcalloc(nval, sizeof(*val), GFP_KERNEL);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 163 if (!val)
4c4129e8af94c1 Heikki Krogerus 2020-02-21 164 return ERR_PTR(-ENOMEM);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 165
4c4129e8af94c1 Heikki Krogerus 2020-02-21 166 nval = fwnode_property_read_u16_array(con->fwnode, "svid", val, nval);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 167 if (nval < 0) {
4c4129e8af94c1 Heikki Krogerus 2020-02-21 168 kfree(val);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 @169 return ERR_PTR(nval);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 170 }
4c4129e8af94c1 Heikki Krogerus 2020-02-21 171
4c4129e8af94c1 Heikki Krogerus 2020-02-21 172 for (i = 0; i < nval; i++) {
4c4129e8af94c1 Heikki Krogerus 2020-02-21 173 match = val[i] == desc->svid;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 174 if (match) {
4c4129e8af94c1 Heikki Krogerus 2020-02-21 175 kfree(val);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 176 goto find_mux;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 177 }
4c4129e8af94c1 Heikki Krogerus 2020-02-21 178 }
4c4129e8af94c1 Heikki Krogerus 2020-02-21 179 kfree(val);
4c4129e8af94c1 Heikki Krogerus 2020-02-21 180 return NULL;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 181
4c4129e8af94c1 Heikki Krogerus 2020-02-21 182 find_mux:
4c4129e8af94c1 Heikki Krogerus 2020-02-21 183 list_for_each_entry(mux, &mux_list, entry)
4c4129e8af94c1 Heikki Krogerus 2020-02-21 184 if (dev_fwnode(mux->dev) == con->fwnode)
4c4129e8af94c1 Heikki Krogerus 2020-02-21 185 return mux;
4c4129e8af94c1 Heikki Krogerus 2020-02-21 186
4c4129e8af94c1 Heikki Krogerus 2020-02-21 187 return match ? ERR_PTR(-EPROBE_DEFER) : NULL;
bdecb33af34f79 Heikki Krogerus 2018-03-20 188 }
bdecb33af34f79 Heikki Krogerus 2018-03-20 189
:::::: The code at line 169 was first introduced by commit
:::::: 4c4129e8af94c11836bd48f475df6fa319c9fada usb: typec: mux: Find the muxes by also matching against the device node
:::::: TO: Heikki Krogerus <heikki.krogerus@linux.intel.com>
:::::: CC: Pavel Machek <pavel@ucw.cz>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-09-27 13:00 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-27 12:59 [cip:linux-4.19.y-cip-rebase 576/965] drivers/usb/typec/mux.c:169 typec_mux_match() warn: missing unwind goto? kernel test robot
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.