* [steev:lenovo-x13s-linux-6.8.y 91/104] drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:242:8: error: no member named 'port_stop' in 'struct pmic_typec'
@ 2024-04-27 15:39 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-04-27 15:39 UTC (permalink / raw
To: Steev Klimaszewski; +Cc: oe-kbuild-all
tree: https://github.com/steev/linux lenovo-x13s-linux-6.8.y
head: 0bde7107456c88f5ccc83c66d7638f1bf02fa8a1
commit: 73754ea4756c40950cfbdfc032c41b547d13bafc [91/104] usb: typec: qcom-pmic: fix use-after-free on late probe errors
config: s390-allmodconfig (https://download.01.org/0day-ci/archive/20240427/202404272337.ed2aS91T-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 5ef5eb66fb428aaf61fb51b709f065c069c11242)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240427/202404272337.ed2aS91T-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>
| Closes: https://lore.kernel.org/oe-kbuild-all/202404272337.ed2aS91T-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:10:
In file included from include/linux/module.h:19:
In file included from include/linux/elf.h:6:
In file included from arch/s390/include/asm/elf.h:173:
In file included from arch/s390/include/asm/mmu_context.h:11:
In file included from arch/s390/include/asm/pgalloc.h:18:
In file included from include/linux/mm.h:2188:
include/linux/vmstat.h:508:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
508 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
509 | item];
| ~~~~
include/linux/vmstat.h:515:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
515 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
516 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
include/linux/vmstat.h:527:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
527 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
528 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
include/linux/vmstat.h:536:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
536 | return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~ ^
537 | NR_VM_NUMA_EVENT_ITEMS +
| ~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:14:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:78:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:37:59: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) __swab16((__force __u16)(__le16)(x))
| ^
include/uapi/linux/swab.h:102:54: note: expanded from macro '__swab16'
102 | #define __swab16(x) (__u16)__builtin_bswap16((__u16)(x))
| ^
In file included from drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:14:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:78:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/big_endian.h:35:59: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) __swab32((__force __u32)(__le32)(x))
| ^
include/uapi/linux/swab.h:115:54: note: expanded from macro '__swab32'
115 | #define __swab32(x) (__u32)__builtin_bswap32((__u32)(x))
| ^
In file included from drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:14:
In file included from include/linux/regmap.h:20:
In file included from include/linux/iopoll.h:14:
In file included from include/linux/io.h:13:
In file included from arch/s390/include/asm/io.h:78:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:692:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
692 | readsb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:700:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
700 | readsw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:708:20: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
708 | readsl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:717:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
717 | writesb(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:726:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
726 | writesw(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:735:21: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
735 | writesl(PCI_IOBASE + addr, buffer, count);
| ~~~~~~~~~~ ^
>> drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:242:8: error: no member named 'port_stop' in 'struct pmic_typec'
242 | tcpm->port_stop(tcpm);
| ~~~~ ^
17 warnings and 1 error generated.
vim +242 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
151
152 static int qcom_pmic_typec_probe(struct platform_device *pdev)
153 {
154 struct pmic_typec *tcpm;
155 struct device *dev = &pdev->dev;
156 struct device_node *np = dev->of_node;
157 const struct pmic_typec_resources *res;
158 struct regmap *regmap;
159 struct device *bridge_dev;
160 u32 base[2];
161 int ret;
162
163 res = of_device_get_match_data(dev);
164 if (!res)
165 return -ENODEV;
166
167 tcpm = devm_kzalloc(dev, sizeof(*tcpm), GFP_KERNEL);
168 if (!tcpm)
169 return -ENOMEM;
170
171 tcpm->dev = dev;
172 tcpm->tcpc.init = qcom_pmic_typec_init;
173 tcpm->tcpc.get_vbus = qcom_pmic_typec_get_vbus;
174 tcpm->tcpc.set_vbus = qcom_pmic_typec_set_vbus;
175 tcpm->tcpc.set_cc = qcom_pmic_typec_set_cc;
176 tcpm->tcpc.get_cc = qcom_pmic_typec_get_cc;
177 tcpm->tcpc.set_polarity = qcom_pmic_typec_set_polarity;
178 tcpm->tcpc.set_vconn = qcom_pmic_typec_set_vconn;
179 tcpm->tcpc.start_toggling = qcom_pmic_typec_start_toggling;
180 tcpm->tcpc.set_pd_rx = qcom_pmic_typec_set_pd_rx;
181 tcpm->tcpc.set_roles = qcom_pmic_typec_set_roles;
182 tcpm->tcpc.pd_transmit = qcom_pmic_typec_pd_transmit;
183
184 regmap = dev_get_regmap(dev->parent, NULL);
185 if (!regmap) {
186 dev_err(dev, "Failed to get regmap\n");
187 return -ENODEV;
188 }
189
190 ret = of_property_read_u32_array(np, "reg", base, 2);
191 if (ret)
192 return ret;
193
194 tcpm->pmic_typec_port = qcom_pmic_typec_port_alloc(dev);
195 if (IS_ERR(tcpm->pmic_typec_port))
196 return PTR_ERR(tcpm->pmic_typec_port);
197
198 tcpm->pmic_typec_pdphy = qcom_pmic_typec_pdphy_alloc(dev);
199 if (IS_ERR(tcpm->pmic_typec_pdphy))
200 return PTR_ERR(tcpm->pmic_typec_pdphy);
201
202 ret = qcom_pmic_typec_port_probe(pdev, tcpm->pmic_typec_port,
203 res->port_res, regmap, base[0]);
204 if (ret)
205 return ret;
206
207 ret = qcom_pmic_typec_pdphy_probe(pdev, tcpm->pmic_typec_pdphy,
208 res->pdphy_res, regmap, base[1]);
209 if (ret)
210 return ret;
211
212 mutex_init(&tcpm->lock);
213 platform_set_drvdata(pdev, tcpm);
214
215 tcpm->tcpc.fwnode = device_get_named_child_node(tcpm->dev, "connector");
216 if (!tcpm->tcpc.fwnode)
217 return -EINVAL;
218
219 bridge_dev = drm_dp_hpd_bridge_register(tcpm->dev, to_of_node(tcpm->tcpc.fwnode));
220 if (IS_ERR(bridge_dev))
221 return PTR_ERR(bridge_dev);
222
223 tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc);
224 if (IS_ERR(tcpm->tcpm_port)) {
225 ret = PTR_ERR(tcpm->tcpm_port);
226 goto fwnode_remove;
227 }
228
229 ret = qcom_pmic_typec_port_start(tcpm->pmic_typec_port,
230 tcpm->tcpm_port);
231 if (ret)
232 goto port_unregister;
233
234 ret = qcom_pmic_typec_pdphy_start(tcpm->pmic_typec_pdphy,
235 tcpm->tcpm_port);
236 if (ret)
237 goto port_stop;
238
239 return 0;
240
241 port_stop:
> 242 tcpm->port_stop(tcpm);
243 port_unregister:
244 tcpm_unregister_port(tcpm->tcpm_port);
245 fwnode_remove:
246 fwnode_remove_software_node(tcpm->tcpc.fwnode);
247
248 return ret;
249 }
250
--
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-04-27 15:39 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-27 15:39 [steev:lenovo-x13s-linux-6.8.y 91/104] drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c:242:8: error: no member named 'port_stop' in 'struct pmic_typec' 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.