Re: [gustavoars-linux:for-next/testing 1/1] ./usr/include/rdma/ib_user_verbs.h:436:34: warning: field 'base' with variable sized type 'struct ib_uverbs_create_cq_resp' not at the end of a struct or class is a GNU extension
by Philip Li
On Fri, Feb 21, 2020 at 01:16:02AM -0600, Gustavo A. R. Silva wrote:
>
>
> On 2/20/20 23:11, Nathan Chancellor wrote:
> > + Gustavo, since I assume the point of that patch is to see what kind of
> > warnings crop up?
> >
>
> Precisely! Thanks, Nathan. :)
>
> I would have expected to get this e-mail automatically... could someone help
> me with that? I'd really appreciate it.
Hi Gustavo, 0-day ci is working on this to send clang build report directly to
author in a few weeks.
>
> Thanks
> --
> Gustavo
>
> > On Fri, Feb 21, 2020 at 11:16:11AM +0800, kbuild test robot wrote:
> >> CC: kbuild-all(a)lists.01.org
> >> TO: "Gustavo A. R. Silva" <gustavo(a)embeddedor.com>
> >>
> >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux.git for-next/testing
> >> head: 2d94fd162464e8b126227a996eaffa9e0442a1be
> >> commit: 2d94fd162464e8b126227a996eaffa9e0442a1be [1/1] treewide: Replace zero-length array with flexible-array member
> >> config: x86_64-allyesconfig (attached as .config)
> >> compiler: clang version 11.0.0 (git://gitmirror/llvm_project 9d37f5afac4a3b9194b9001bed84f58ca8bd6c02)
> >> reproduce:
> >> git checkout 2d94fd162464e8b126227a996eaffa9e0442a1be
> >> # save the attached .config to linux build tree
> >> make ARCH=x86_64
> >>
> >> If you fix the issue, kindly add following tag
> >> Reported-by: kbuild test robot <lkp(a)intel.com>
> >>
> >> All warnings (new ones prefixed by >>):
> >>
> >> In file included from <built-in>:1:
> >> In file included from ./usr/include/rdma/rdma_user_cm.h:40:
> >>>> ./usr/include/rdma/ib_user_verbs.h:436:34: warning: field 'base' with variable sized type 'struct ib_uverbs_create_cq_resp' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> >> struct ib_uverbs_create_cq_resp base;
> >> ^
> >>>> ./usr/include/rdma/ib_user_verbs.h:647:34: warning: field 'base' with variable sized type 'struct ib_uverbs_create_qp_resp' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> >> struct ib_uverbs_create_qp_resp base;
> >> ^
> >>>> ./usr/include/rdma/ib_user_verbs.h:743:29: warning: field 'base' with variable sized type 'struct ib_uverbs_modify_qp' not at the end of a struct or class is a GNU extension [-Wgnu-variable-sized-type-not-at-end]
> >> struct ib_uverbs_modify_qp base;
> >> ^
> >> 3 warnings generated.
> >>
> >> ---
> >> 0-DAY CI Kernel Test Service, Intel Corporation
> >> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> >>
>
1 year
[linux-next:master 2342/3265] net/bluetooth/smp.c:2185 smp_cmd_pairing_random() error: uninitialized symbol 'passkey'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 1d7f85df0f9c0456520ae86dc597bca87980d253
commit: cee5f20fece32cd1722230cb05333f39db860698 [2342/3265] Bluetooth: secure bluetooth stack from bluedump attack
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/bluetooth/smp.c:2185 smp_cmd_pairing_random() error: uninitialized symbol 'passkey'.
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout cee5f20fece32cd1722230cb05333f39db860698
vim +/passkey +2185 net/bluetooth/smp.c
da85e5e5afeb72 Vinicius Costa Gomes 2011-06-09 2113 static u8 smp_cmd_pairing_random(struct l2cap_conn *conn, struct sk_buff *skb)
88ba43b662b6b9 Anderson Briglia 2011-06-09 2114 {
5d88cc73dded31 Johan Hedberg 2014-08-08 2115 struct l2cap_chan *chan = conn->smp;
5d88cc73dded31 Johan Hedberg 2014-08-08 2116 struct smp_chan *smp = chan->data;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2117 struct hci_conn *hcon = conn->hcon;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2118 u8 *pkax, *pkbx, *na, *nb;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2119 u32 passkey;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2120 int err;
7d24ddcc1140d2 Anderson Briglia 2011-06-09 2121
8aab47574a7f5b Vinicius Costa Gomes 2011-09-05 2122 BT_DBG("conn %p", conn);
7d24ddcc1140d2 Anderson Briglia 2011-06-09 2123
c46b98bea5691c Johan Hedberg 2014-02-18 2124 if (skb->len < sizeof(smp->rrnd))
38e4a915663f3f Johan Hedberg 2014-05-08 2125 return SMP_INVALID_PARAMS;
c46b98bea5691c Johan Hedberg 2014-02-18 2126
943a732ab6440f Johan Hedberg 2014-03-18 2127 memcpy(smp->rrnd, skb->data, sizeof(smp->rrnd));
8aab47574a7f5b Vinicius Costa Gomes 2011-09-05 2128 skb_pull(skb, sizeof(smp->rrnd));
3158c50c33c1ac Vinicius Costa Gomes 2011-06-14 2129
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2130 if (!test_bit(SMP_FLAG_SC, &smp->flags))
861580a970f1ab Johan Hedberg 2014-05-20 2131 return smp_random(smp);
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2132
580039e838a7ef Johan Hedberg 2014-12-03 2133 if (hcon->out) {
580039e838a7ef Johan Hedberg 2014-12-03 2134 pkax = smp->local_pk;
580039e838a7ef Johan Hedberg 2014-12-03 2135 pkbx = smp->remote_pk;
580039e838a7ef Johan Hedberg 2014-12-03 2136 na = smp->prnd;
580039e838a7ef Johan Hedberg 2014-12-03 2137 nb = smp->rrnd;
580039e838a7ef Johan Hedberg 2014-12-03 2138 } else {
580039e838a7ef Johan Hedberg 2014-12-03 2139 pkax = smp->remote_pk;
580039e838a7ef Johan Hedberg 2014-12-03 2140 pkbx = smp->local_pk;
580039e838a7ef Johan Hedberg 2014-12-03 2141 na = smp->rrnd;
580039e838a7ef Johan Hedberg 2014-12-03 2142 nb = smp->prnd;
580039e838a7ef Johan Hedberg 2014-12-03 2143 }
580039e838a7ef Johan Hedberg 2014-12-03 2144
a29b073351ffdd Johan Hedberg 2014-10-28 2145 if (smp->method == REQ_OOB) {
a29b073351ffdd Johan Hedberg 2014-10-28 2146 if (!hcon->out)
a29b073351ffdd Johan Hedberg 2014-10-28 2147 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM,
a29b073351ffdd Johan Hedberg 2014-10-28 2148 sizeof(smp->prnd), smp->prnd);
a29b073351ffdd Johan Hedberg 2014-10-28 2149 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
a29b073351ffdd Johan Hedberg 2014-10-28 2150 goto mackey_and_ltk;
a29b073351ffdd Johan Hedberg 2014-10-28 2151 }
a29b073351ffdd Johan Hedberg 2014-10-28 2152
38606f1418cc9c Johan Hedberg 2014-06-25 2153 /* Passkey entry has special treatment */
38606f1418cc9c Johan Hedberg 2014-06-25 2154 if (smp->method == REQ_PASSKEY || smp->method == DSP_PASSKEY)
38606f1418cc9c Johan Hedberg 2014-06-25 2155 return sc_passkey_round(smp, SMP_CMD_PAIRING_RANDOM);
38606f1418cc9c Johan Hedberg 2014-06-25 2156
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2157 if (hcon->out) {
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2158 u8 cfm[16];
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2159
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2160 err = smp_f4(smp->tfm_cmac, smp->remote_pk, smp->local_pk,
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2161 smp->rrnd, 0, cfm);
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2162 if (err)
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2163 return SMP_UNSPECIFIED;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2164
329d82309824ff Jason A. Donenfeld 2017-06-10 2165 if (crypto_memneq(smp->pcnf, cfm, 16))
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2166 return SMP_CONFIRM_FAILED;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2167 } else {
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2168 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM, sizeof(smp->prnd),
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2169 smp->prnd);
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2170 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
cee5f20fece32c Howard Chung 2020-02-14 2171
cee5f20fece32c Howard Chung 2020-02-14 2172 /* Only Just-Works pairing requires extra checks */
cee5f20fece32c Howard Chung 2020-02-14 2173 if (smp->method != JUST_WORKS)
cee5f20fece32c Howard Chung 2020-02-14 2174 goto mackey_and_ltk;
cee5f20fece32c Howard Chung 2020-02-14 2175
cee5f20fece32c Howard Chung 2020-02-14 2176 /* If there already exists long term key in local host, leave
cee5f20fece32c Howard Chung 2020-02-14 2177 * the decision to user space since the remote device could
cee5f20fece32c Howard Chung 2020-02-14 2178 * be legitimate or malicious.
cee5f20fece32c Howard Chung 2020-02-14 2179 */
cee5f20fece32c Howard Chung 2020-02-14 2180 if (hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type,
cee5f20fece32c Howard Chung 2020-02-14 2181 hcon->role)) {
cee5f20fece32c Howard Chung 2020-02-14 2182 err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst,
cee5f20fece32c Howard Chung 2020-02-14 2183 hcon->type,
cee5f20fece32c Howard Chung 2020-02-14 2184 hcon->dst_type,
cee5f20fece32c Howard Chung 2020-02-14 @2185 passkey, 1);
^^^^^^^
Uninitialized until later in the function.
cee5f20fece32c Howard Chung 2020-02-14 2186 if (err)
cee5f20fece32c Howard Chung 2020-02-14 2187 return SMP_UNSPECIFIED;
cee5f20fece32c Howard Chung 2020-02-14 2188 set_bit(SMP_FLAG_WAIT_USER, &smp->flags);
cee5f20fece32c Howard Chung 2020-02-14 2189 }
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2190 }
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2191
a29b073351ffdd Johan Hedberg 2014-10-28 2192 mackey_and_ltk:
760b018b6cf08e Johan Hedberg 2014-06-06 2193 /* Generate MacKey and LTK */
760b018b6cf08e Johan Hedberg 2014-06-06 2194 err = sc_mackey_and_ltk(smp, smp->mackey, smp->tk);
760b018b6cf08e Johan Hedberg 2014-06-06 2195 if (err)
760b018b6cf08e Johan Hedberg 2014-06-06 2196 return SMP_UNSPECIFIED;
760b018b6cf08e Johan Hedberg 2014-06-06 2197
a29b073351ffdd Johan Hedberg 2014-10-28 2198 if (smp->method == JUST_WORKS || smp->method == REQ_OOB) {
dddd3059e3bdd0 Johan Hedberg 2014-06-01 2199 if (hcon->out) {
38606f1418cc9c Johan Hedberg 2014-06-25 2200 sc_dhkey_check(smp);
dddd3059e3bdd0 Johan Hedberg 2014-06-01 2201 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK);
dddd3059e3bdd0 Johan Hedberg 2014-06-01 2202 }
dddd3059e3bdd0 Johan Hedberg 2014-06-01 2203 return 0;
dddd3059e3bdd0 Johan Hedberg 2014-06-01 2204 }
dddd3059e3bdd0 Johan Hedberg 2014-06-01 2205
38606f1418cc9c Johan Hedberg 2014-06-25 2206 err = smp_g2(smp->tfm_cmac, pkax, pkbx, na, nb, &passkey);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38606f1418cc9c Johan Hedberg 2014-06-25 2207 if (err)
38606f1418cc9c Johan Hedberg 2014-06-25 2208 return SMP_UNSPECIFIED;
38606f1418cc9c Johan Hedberg 2014-06-25 2209
38606f1418cc9c Johan Hedberg 2014-06-25 2210 err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type,
38606f1418cc9c Johan Hedberg 2014-06-25 2211 hcon->dst_type, passkey, 0);
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2212 if (err)
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2213 return SMP_UNSPECIFIED;
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2214
38606f1418cc9c Johan Hedberg 2014-06-25 2215 set_bit(SMP_FLAG_WAIT_USER, &smp->flags);
38606f1418cc9c Johan Hedberg 2014-06-25 2216
191dc7fe2d3a8d Johan Hedberg 2014-06-06 2217 return 0;
88ba43b662b6b9 Anderson Briglia 2011-06-09 2218 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[mlankhorst:locking-rework 20/21] drivers/gpu/drm/i915/gt/intel_context.c:463 intel_context_create_request() error: uninitialized symbol 'rq'.
by Dan Carpenter
tree: git://people.freedesktop.org/~mlankhorst/linux locking-rework
head: 815e39f70354544bbdf2e396c3ed5c0375c2dd3b
commit: 9372cceb3c597ab5b169b0eb96063962ec340fc2 [20/21] drm/i915: Use ww pinning for intel_context_create_request()
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/gpu/drm/i915/gt/intel_context.c:463 intel_context_create_request() error: uninitialized symbol 'rq'.
Old smatch warnings:
drivers/gpu/drm/i915/gem/i915_gem_object.h:132 __i915_gem_object_lock() error: we previously assumed 'ww' could be null (see line 124)
git remote add mlankhorst git://people.freedesktop.org/~mlankhorst/linux
git remote update mlankhorst
git checkout 9372cceb3c597ab5b169b0eb96063962ec340fc2
vim +/rq +463 drivers/gpu/drm/i915/gt/intel_context.c
5e2a0419ef7cb2 Chris Wilson 2019-04-26 441 struct i915_request *intel_context_create_request(struct intel_context *ce)
5e2a0419ef7cb2 Chris Wilson 2019-04-26 442 {
9372cceb3c597a Maarten Lankhorst 2020-02-14 443 struct i915_gem_ww_ctx ww;
5e2a0419ef7cb2 Chris Wilson 2019-04-26 444 struct i915_request *rq;
5e2a0419ef7cb2 Chris Wilson 2019-04-26 445 int err;
5e2a0419ef7cb2 Chris Wilson 2019-04-26 446
9372cceb3c597a Maarten Lankhorst 2020-02-14 447 i915_gem_ww_ctx_init(&ww, true);
9372cceb3c597a Maarten Lankhorst 2020-02-14 448 retry:
9372cceb3c597a Maarten Lankhorst 2020-02-14 449 err = intel_context_pin_ww(ce, &ww);
9372cceb3c597a Maarten Lankhorst 2020-02-14 450 if (!err) {
5e2a0419ef7cb2 Chris Wilson 2019-04-26 451 rq = i915_request_create(ce);
5e2a0419ef7cb2 Chris Wilson 2019-04-26 452 intel_context_unpin(ce);
9372cceb3c597a Maarten Lankhorst 2020-02-14 453 } else if (err == -EDEADLK) {
9372cceb3c597a Maarten Lankhorst 2020-02-14 454 err = i915_gem_ww_ctx_backoff(&ww);
9372cceb3c597a Maarten Lankhorst 2020-02-14 455 if (!err)
9372cceb3c597a Maarten Lankhorst 2020-02-14 456 goto retry;
"rq" not set on this path.
9372cceb3c597a Maarten Lankhorst 2020-02-14 457 } else {
9372cceb3c597a Maarten Lankhorst 2020-02-14 458 rq = ERR_PTR(err);
9372cceb3c597a Maarten Lankhorst 2020-02-14 459 }
9372cceb3c597a Maarten Lankhorst 2020-02-14 460
9372cceb3c597a Maarten Lankhorst 2020-02-14 461 i915_gem_ww_ctx_fini(&ww);
5e2a0419ef7cb2 Chris Wilson 2019-04-26 462
d3717eb59c723a Maarten Lankhorst 2020-01-28 @463 if (IS_ERR(rq))
^^
d3717eb59c723a Maarten Lankhorst 2020-01-28 464 return rq;
d3717eb59c723a Maarten Lankhorst 2020-01-28 465
d3717eb59c723a Maarten Lankhorst 2020-01-28 466 /*
d3717eb59c723a Maarten Lankhorst 2020-01-28 467 * timeline->mutex should be the inner lock, but is used as outer lock.
d3717eb59c723a Maarten Lankhorst 2020-01-28 468 * Hack around this to shut up lockdep in selftests..
d3717eb59c723a Maarten Lankhorst 2020-01-28 469 */
d3717eb59c723a Maarten Lankhorst 2020-01-28 470 lockdep_unpin_lock(&ce->timeline->mutex, rq->cookie);
d3717eb59c723a Maarten Lankhorst 2020-01-28 471 mutex_release(&ce->timeline->mutex.dep_map, _RET_IP_);
d3717eb59c723a Maarten Lankhorst 2020-01-28 472 mutex_acquire(&ce->timeline->mutex.dep_map, SINGLE_DEPTH_NESTING, 0, _RET_IP_);
d3717eb59c723a Maarten Lankhorst 2020-01-28 473 rq->cookie = lockdep_pin_lock(&ce->timeline->mutex);
d3717eb59c723a Maarten Lankhorst 2020-01-28 474
5e2a0419ef7cb2 Chris Wilson 2019-04-26 475 return rq;
5e2a0419ef7cb2 Chris Wilson 2019-04-26 476 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [PATCH] proc: faster open/read/close with "permanent" files
by Dan Carpenter
Hi Alexey,
url: https://github.com/0day-ci/linux/commits/Alexey-Dobriyan/proc-faster-open...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux.git modules-next
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
fs/proc/generic.c:752 remove_proc_subtree() warn: inconsistent returns 'proc_subdir_lock'.
# https://github.com/0day-ci/linux/commit/3cd4ad42ca7c52d1513e7ba9f08a06197...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 3cd4ad42ca7c52d1513e7ba9f08a06197a7380c8
vim +/proc_subdir_lock +752 fs/proc/generic.c
8ce584c7416d8a Al Viro 2013-03-30 699
8ce584c7416d8a Al Viro 2013-03-30 700 int remove_proc_subtree(const char *name, struct proc_dir_entry *parent)
8ce584c7416d8a Al Viro 2013-03-30 701 {
8ce584c7416d8a Al Viro 2013-03-30 702 struct proc_dir_entry *root = NULL, *de, *next;
8ce584c7416d8a Al Viro 2013-03-30 703 const char *fn = name;
8ce584c7416d8a Al Viro 2013-03-30 704 unsigned int len;
8ce584c7416d8a Al Viro 2013-03-30 705
ecf1a3dfff22bd Waiman Long 2015-09-09 706 write_lock(&proc_subdir_lock);
8ce584c7416d8a Al Viro 2013-03-30 707 if (__xlate_proc_name(name, &parent, &fn) != 0) {
ecf1a3dfff22bd Waiman Long 2015-09-09 708 write_unlock(&proc_subdir_lock);
8ce584c7416d8a Al Viro 2013-03-30 709 return -ENOENT;
8ce584c7416d8a Al Viro 2013-03-30 710 }
8ce584c7416d8a Al Viro 2013-03-30 711 len = strlen(fn);
8ce584c7416d8a Al Viro 2013-03-30 712
710585d4922fd3 Nicolas Dichtel 2014-12-10 713 root = pde_subdir_find(parent, fn, len);
8ce584c7416d8a Al Viro 2013-03-30 714 if (!root) {
ecf1a3dfff22bd Waiman Long 2015-09-09 715 write_unlock(&proc_subdir_lock);
8ce584c7416d8a Al Viro 2013-03-30 716 return -ENOENT;
8ce584c7416d8a Al Viro 2013-03-30 717 }
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 718 if (unlikely(pde_is_permanent(root))) {
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 719 WARN(1, "removing permanent /proc entry '%s/%s'",
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 720 root->parent->name, root->name);
unlock?
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 721 return -EINVAL;
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 722 }
4f1134370a29a5 Alexey Dobriyan 2018-04-10 723 rb_erase(&root->subdir_node, &parent->subdir);
710585d4922fd3 Nicolas Dichtel 2014-12-10 724
8ce584c7416d8a Al Viro 2013-03-30 725 de = root;
8ce584c7416d8a Al Viro 2013-03-30 726 while (1) {
710585d4922fd3 Nicolas Dichtel 2014-12-10 727 next = pde_subdir_first(de);
8ce584c7416d8a Al Viro 2013-03-30 728 if (next) {
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 729 if (unlikely(pde_is_permanent(root))) {
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 730 WARN(1, "removing permanent /proc entry '%s/%s'",
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 731 next->parent->name, next->name);
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 732 return -EINVAL;
3cd4ad42ca7c52 Alexey Dobriyan 2020-02-16 733 }
4f1134370a29a5 Alexey Dobriyan 2018-04-10 734 rb_erase(&next->subdir_node, &de->subdir);
8ce584c7416d8a Al Viro 2013-03-30 735 de = next;
8ce584c7416d8a Al Viro 2013-03-30 736 continue;
8ce584c7416d8a Al Viro 2013-03-30 737 }
8ce584c7416d8a Al Viro 2013-03-30 738 next = de->parent;
8ce584c7416d8a Al Viro 2013-03-30 739 if (S_ISDIR(de->mode))
8ce584c7416d8a Al Viro 2013-03-30 740 next->nlink--;
e06689bf57017a Alexey Dobriyan 2019-12-04 741 write_unlock(&proc_subdir_lock);
e06689bf57017a Alexey Dobriyan 2019-12-04 742
e06689bf57017a Alexey Dobriyan 2019-12-04 743 proc_entry_rundown(de);
8ce584c7416d8a Al Viro 2013-03-30 744 if (de == root)
8ce584c7416d8a Al Viro 2013-03-30 745 break;
8ce584c7416d8a Al Viro 2013-03-30 746 pde_put(de);
8ce584c7416d8a Al Viro 2013-03-30 747
ecf1a3dfff22bd Waiman Long 2015-09-09 748 write_lock(&proc_subdir_lock);
8ce584c7416d8a Al Viro 2013-03-30 749 de = next;
8ce584c7416d8a Al Viro 2013-03-30 750 }
8ce584c7416d8a Al Viro 2013-03-30 751 pde_put(root);
8ce584c7416d8a Al Viro 2013-03-30 @752 return 0;
8ce584c7416d8a Al Viro 2013-03-30 753 }
8ce584c7416d8a Al Viro 2013-03-30 754 EXPORT_SYMBOL(remove_proc_subtree);
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
Re: [PATCH v3 2/2] input: adp5589: Add basic devicetree support
by Dan Carpenter
Hi Alexandru,
url: https://urldefense.com/v3/__https://github.com/0day-ci/linux/commits/Alex...
base: https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/g... next
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/input/keyboard/adp5589-keys.c:1053 adp5589_probe() warn: possible memory leak of 'kpad'
Old smatch warnings:
drivers/input/keyboard/adp5589-keys.c:913 adp5589_keypad_add() error: we previously assumed 'pdata->gpimap' could be null (see line 902)
# https://urldefense.com/v3/__https://github.com/0day-ci/linux/commit/e537d...
git remote add linux-review https://urldefense.com/v3/__https://github.com/0day-ci/linux__;!!GqivPVa7...
git remote update linux-review
git checkout e537dc5175805cf765da36bdd9cafe98b0a191d9
vim +/kpad +1053 drivers/input/keyboard/adp5589-keys.c
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1030 static int adp5589_probe(struct i2c_client *client,
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1031 const struct i2c_device_id *id)
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1032 {
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1033 struct adp5589_kpad *kpad;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1034 const struct adp5589_kpad_platform_data *pdata =
ba322093a2bfbb Lars-Peter Clausen 2020-02-05 1035 adp5589_kpad_pdata_get(&client->dev);
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1036 unsigned int revid;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1037 int error, ret;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1038
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1039 if (!i2c_check_functionality(client->adapter,
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1040 I2C_FUNC_SMBUS_BYTE_DATA)) {
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1041 dev_err(&client->dev, "SMBUS Byte Data not Supported\n");
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1042 return -EIO;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1043 }
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1044
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1045 kpad = kzalloc(sizeof(*kpad), GFP_KERNEL);
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1046 if (!kpad)
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1047 return -ENOMEM;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1048
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1049 kpad->client = client;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1050
e537dc5175805c Lars-Peter Clausen 2020-02-05 1051 ret = adp5589_i2c_get_driver_data(client, id);
e537dc5175805c Lars-Peter Clausen 2020-02-05 1052 if (ret < 0)
e537dc5175805c Lars-Peter Clausen 2020-02-05 @1053 return ret;
error = ret;
goto err_free_mem;
Better to just delete the "error" variable though and make everything
ret.
e537dc5175805c Lars-Peter Clausen 2020-02-05 1054
e537dc5175805c Lars-Peter Clausen 2020-02-05 1055 switch (ret) {
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1056 case ADP5585_02:
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1057 kpad->support_row5 = true;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1058 /* fall through */
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1059 case ADP5585_01:
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1060 kpad->is_adp5585 = true;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1061 kpad->var = &const_adp5585;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1062 break;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1063 case ADP5589:
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1064 kpad->support_row5 = true;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1065 kpad->var = &const_adp5589;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1066 break;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1067 }
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1068
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1069 ret = adp5589_read(client, ADP5589_5_ID);
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1070 if (ret < 0) {
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1071 error = ret;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1072 goto err_free_mem;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1073 }
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1074
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1075 revid = (u8) ret & ADP5589_5_DEVICE_ID_MASK;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1076
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1077 if (pdata->keymapsize) {
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1078 error = adp5589_keypad_add(kpad, revid);
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1079 if (error)
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1080 goto err_free_mem;
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1081 }
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1082
9d2e173644bb5c Michael Hennerich 2011-05-19 1083 error = adp5589_setup(kpad);
9d2e173644bb5c Michael Hennerich 2011-05-19 1084 if (error)
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1085 goto err_keypad_remove;
9d2e173644bb5c Michael Hennerich 2011-05-19 1086
9d2e173644bb5c Michael Hennerich 2011-05-19 1087 if (kpad->gpimapsize)
9d2e173644bb5c Michael Hennerich 2011-05-19 1088 adp5589_report_switch_state(kpad);
9d2e173644bb5c Michael Hennerich 2011-05-19 1089
9d2e173644bb5c Michael Hennerich 2011-05-19 1090 error = adp5589_gpio_add(kpad);
9d2e173644bb5c Michael Hennerich 2011-05-19 1091 if (error)
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1092 goto err_keypad_remove;
9d2e173644bb5c Michael Hennerich 2011-05-19 1093
9d2e173644bb5c Michael Hennerich 2011-05-19 1094 i2c_set_clientdata(client, kpad);
9d2e173644bb5c Michael Hennerich 2011-05-19 1095
9d2e173644bb5c Michael Hennerich 2011-05-19 1096 dev_info(&client->dev, "Rev.%d keypad, irq %d\n", revid, client->irq);
9d2e173644bb5c Michael Hennerich 2011-05-19 1097 return 0;
9d2e173644bb5c Michael Hennerich 2011-05-19 1098
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1099 err_keypad_remove:
cb3efd5a38855e Lars-Peter Clausen 2019-10-23 1100 adp5589_keypad_remove(kpad);
3f48e735435851 Michael Hennerich 2011-10-18 1101 err_free_mem:
9d2e173644bb5c Michael Hennerich 2011-05-19 1102 kfree(kpad);
9d2e173644bb5c Michael Hennerich 2011-05-19 1103
9d2e173644bb5c Michael Hennerich 2011-05-19 1104 return error;
9d2e173644bb5c Michael Hennerich 2011-05-19 1105 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://urldefense.com/v3/__https://lists.01.org/hyperkitty/list/kbuild-a...
1 year
[linux-next:master 1282/1397] fs/io_uring.c:3728 io_poll_double_wake() error: uninitialized symbol 'ret'.
by Dan Carpenter
tree: https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/g... master
head: ac431e2d7b1be81bfe58163b9f81ba79bc987dc3
commit: 2b10058375d18e69d14955888fd55591cc553582 [1282/1397] io_uring: allow POLL_ADD with double poll_wait() users
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
fs/io_uring.c:3728 io_poll_double_wake() error: uninitialized symbol 'ret'.
Old smatch warnings:
fs/io_uring.c:2191 io_setup_async_rw() error: we previously assumed 'req->io' could be null (see line 2187)
fs/io_uring.c:5949 __io_sqe_files_update() error: uninitialized symbol 'err'.
# https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/g...
git remote add linux-next https://urldefense.com/v3/__https://git.kernel.org/pub/scm/linux/kernel/g...
git remote update linux-next
git checkout 2b10058375d18e69d14955888fd55591cc553582
vim +/ret +3728 fs/io_uring.c
2b10058375d18e Jens Axboe 2020-02-10 3703 static int io_poll_double_wake(struct wait_queue_entry *wait, unsigned mode,
2b10058375d18e Jens Axboe 2020-02-10 3704 int sync, void *key)
2b10058375d18e Jens Axboe 2020-02-10 3705 {
2b10058375d18e Jens Axboe 2020-02-10 3706 struct io_kiocb *req = wait->private;
2b10058375d18e Jens Axboe 2020-02-10 3707 struct io_poll_iocb *poll = (void *) req->io;
2b10058375d18e Jens Axboe 2020-02-10 3708 __poll_t mask = key_to_poll(key);
2b10058375d18e Jens Axboe 2020-02-10 3709 bool done = true;
2b10058375d18e Jens Axboe 2020-02-10 3710 int ret;
2b10058375d18e Jens Axboe 2020-02-10 3711
2b10058375d18e Jens Axboe 2020-02-10 3712 /* for instances that support it check for an event match first: */
2b10058375d18e Jens Axboe 2020-02-10 3713 if (mask && !(mask & poll->events))
2b10058375d18e Jens Axboe 2020-02-10 3714 return 0;
2b10058375d18e Jens Axboe 2020-02-10 3715
2b10058375d18e Jens Axboe 2020-02-10 3716 if (req->poll.head) {
2b10058375d18e Jens Axboe 2020-02-10 3717 unsigned long flags;
2b10058375d18e Jens Axboe 2020-02-10 3718
2b10058375d18e Jens Axboe 2020-02-10 3719 spin_lock_irqsave(&req->poll.head->lock, flags);
2b10058375d18e Jens Axboe 2020-02-10 3720 done = list_empty(&req->poll.wait.entry);
2b10058375d18e Jens Axboe 2020-02-10 3721 if (!done)
2b10058375d18e Jens Axboe 2020-02-10 3722 list_del_init(&req->poll.wait.entry);
2b10058375d18e Jens Axboe 2020-02-10 3723 spin_unlock_irqrestore(&req->poll.head->lock, flags);
2b10058375d18e Jens Axboe 2020-02-10 3724 }
2b10058375d18e Jens Axboe 2020-02-10 3725 if (!done)
2b10058375d18e Jens Axboe 2020-02-10 3726 __io_poll_wake(req, poll, mask);
2b10058375d18e Jens Axboe 2020-02-10 3727 refcount_dec(&req->refs);
2b10058375d18e Jens Axboe 2020-02-10 @3728 return ret;
return 0;
2b10058375d18e Jens Axboe 2020-02-10 3729 }
2b10058375d18e Jens Axboe 2020-02-10 3730
---
0-DAY CI Kernel Test Service, Intel Corporation
https://urldefense.com/v3/__https://lists.01.org/hyperkitty/list/kbuild-a...
1 year
[linux-next:master 1249/1397] drivers/hwmon/axi-fan-control.c:418 axi_fan_control_probe() error: potentially dereferencing uninitialized 'res'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ac431e2d7b1be81bfe58163b9f81ba79bc987dc3
commit: 690dd9ce04f6a1b319bcb211ee0b3e125a4fa4f2 [1249/1397] hwmon: Support ADI Fan Control IP
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/hwmon/axi-fan-control.c:418 axi_fan_control_probe() error: potentially dereferencing uninitialized 'res'.
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git remote update linux-next
git checkout 690dd9ce04f6a1b319bcb211ee0b3e125a4fa4f2
vim +/res +418 drivers/hwmon/axi-fan-control.c
690dd9ce04f6a1 Nuno Sá 2019-10-09 386 static int axi_fan_control_probe(struct platform_device *pdev)
690dd9ce04f6a1 Nuno Sá 2019-10-09 387 {
690dd9ce04f6a1 Nuno Sá 2019-10-09 388 struct axi_fan_control_data *ctl;
690dd9ce04f6a1 Nuno Sá 2019-10-09 389 struct clk *clk;
690dd9ce04f6a1 Nuno Sá 2019-10-09 390 const struct of_device_id *id;
690dd9ce04f6a1 Nuno Sá 2019-10-09 391 const char *name = "axi_fan_control";
690dd9ce04f6a1 Nuno Sá 2019-10-09 392 struct resource *res;
690dd9ce04f6a1 Nuno Sá 2019-10-09 393 u32 version;
690dd9ce04f6a1 Nuno Sá 2019-10-09 394 int ret;
690dd9ce04f6a1 Nuno Sá 2019-10-09 395
690dd9ce04f6a1 Nuno Sá 2019-10-09 396 id = of_match_node(axi_fan_control_of_match, pdev->dev.of_node);
690dd9ce04f6a1 Nuno Sá 2019-10-09 397 if (!id)
690dd9ce04f6a1 Nuno Sá 2019-10-09 398 return -EINVAL;
690dd9ce04f6a1 Nuno Sá 2019-10-09 399
690dd9ce04f6a1 Nuno Sá 2019-10-09 400 ctl = devm_kzalloc(&pdev->dev, sizeof(*ctl), GFP_KERNEL);
690dd9ce04f6a1 Nuno Sá 2019-10-09 401 if (!ctl)
690dd9ce04f6a1 Nuno Sá 2019-10-09 402 return -ENOMEM;
690dd9ce04f6a1 Nuno Sá 2019-10-09 403
690dd9ce04f6a1 Nuno Sá 2019-10-09 404 ctl->base = devm_platform_ioremap_resource(pdev, 0);
690dd9ce04f6a1 Nuno Sá 2019-10-09 405 if (IS_ERR(ctl->base))
690dd9ce04f6a1 Nuno Sá 2019-10-09 406 return PTR_ERR(ctl->base);
690dd9ce04f6a1 Nuno Sá 2019-10-09 407
690dd9ce04f6a1 Nuno Sá 2019-10-09 408 clk = devm_clk_get(&pdev->dev, NULL);
690dd9ce04f6a1 Nuno Sá 2019-10-09 409 if (IS_ERR(clk)) {
690dd9ce04f6a1 Nuno Sá 2019-10-09 410 dev_err(&pdev->dev, "clk_get failed with %ld\n", PTR_ERR(clk));
690dd9ce04f6a1 Nuno Sá 2019-10-09 411 return PTR_ERR(clk);
690dd9ce04f6a1 Nuno Sá 2019-10-09 412 }
690dd9ce04f6a1 Nuno Sá 2019-10-09 413
690dd9ce04f6a1 Nuno Sá 2019-10-09 414 ctl->clk_rate = clk_get_rate(clk);
690dd9ce04f6a1 Nuno Sá 2019-10-09 415 if (!ctl->clk_rate)
690dd9ce04f6a1 Nuno Sá 2019-10-09 416 return -EINVAL;
690dd9ce04f6a1 Nuno Sá 2019-10-09 417
690dd9ce04f6a1 Nuno Sá 2019-10-09 @418 dev_dbg(&pdev->dev, "Re-mapped from 0x%08llX to %p\n",
690dd9ce04f6a1 Nuno Sá 2019-10-09 419 (unsigned long long)res->start, ctl->base);
^^^^^^^^^^
"res" is never set or used anywhere.
690dd9ce04f6a1 Nuno Sá 2019-10-09 420
690dd9ce04f6a1 Nuno Sá 2019-10-09 421 version = axi_ioread(ADI_AXI_REG_VERSION, ctl);
690dd9ce04f6a1 Nuno Sá 2019-10-09 422 if (ADI_AXI_PCORE_VER_MAJOR(version) !=
690dd9ce04f6a1 Nuno Sá 2019-10-09 423 ADI_AXI_PCORE_VER_MAJOR((*(u32 *)id->data))) {
690dd9ce04f6a1 Nuno Sá 2019-10-09 424 dev_err(&pdev->dev, "Major version mismatch. Expected %d.%.2d.%c, Reported %d.%.2d.%c\n",
690dd9ce04f6a1 Nuno Sá 2019-10-09 425 ADI_AXI_PCORE_VER_MAJOR((*(u32 *)id->data)),
690dd9ce04f6a1 Nuno Sá 2019-10-09 426 ADI_AXI_PCORE_VER_MINOR((*(u32 *)id->data)),
690dd9ce04f6a1 Nuno Sá 2019-10-09 427 ADI_AXI_PCORE_VER_PATCH((*(u32 *)id->data)),
690dd9ce04f6a1 Nuno Sá 2019-10-09 428 ADI_AXI_PCORE_VER_MAJOR(version),
690dd9ce04f6a1 Nuno Sá 2019-10-09 429 ADI_AXI_PCORE_VER_MINOR(version),
690dd9ce04f6a1 Nuno Sá 2019-10-09 430 ADI_AXI_PCORE_VER_PATCH(version));
690dd9ce04f6a1 Nuno Sá 2019-10-09 431 return -ENODEV;
690dd9ce04f6a1 Nuno Sá 2019-10-09 432 }
690dd9ce04f6a1 Nuno Sá 2019-10-09 433
690dd9ce04f6a1 Nuno Sá 2019-10-09 434 ctl->irq = platform_get_irq(pdev, 0);
690dd9ce04f6a1 Nuno Sá 2019-10-09 435 if (ctl->irq < 0)
690dd9ce04f6a1 Nuno Sá 2019-10-09 436 return ctl->irq;
690dd9ce04f6a1 Nuno Sá 2019-10-09 437
690dd9ce04f6a1 Nuno Sá 2019-10-09 438 ret = devm_request_threaded_irq(&pdev->dev, ctl->irq, NULL,
690dd9ce04f6a1 Nuno Sá 2019-10-09 439 axi_fan_control_irq_handler,
690dd9ce04f6a1 Nuno Sá 2019-10-09 440 IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
690dd9ce04f6a1 Nuno Sá 2019-10-09 441 pdev->driver_override, ctl);
690dd9ce04f6a1 Nuno Sá 2019-10-09 442 if (ret) {
690dd9ce04f6a1 Nuno Sá 2019-10-09 443 dev_err(&pdev->dev, "failed to request an irq, %d", ret);
690dd9ce04f6a1 Nuno Sá 2019-10-09 444 return ret;
690dd9ce04f6a1 Nuno Sá 2019-10-09 445 }
690dd9ce04f6a1 Nuno Sá 2019-10-09 446
690dd9ce04f6a1 Nuno Sá 2019-10-09 447 ret = axi_fan_control_init(ctl, pdev->dev.of_node);
690dd9ce04f6a1 Nuno Sá 2019-10-09 448 if (ret) {
690dd9ce04f6a1 Nuno Sá 2019-10-09 449 dev_err(&pdev->dev, "Failed to initialize device\n");
690dd9ce04f6a1 Nuno Sá 2019-10-09 450 return ret;
690dd9ce04f6a1 Nuno Sá 2019-10-09 451 }
690dd9ce04f6a1 Nuno Sá 2019-10-09 452
690dd9ce04f6a1 Nuno Sá 2019-10-09 453 ctl->hdev = devm_hwmon_device_register_with_info(&pdev->dev,
690dd9ce04f6a1 Nuno Sá 2019-10-09 454 name,
690dd9ce04f6a1 Nuno Sá 2019-10-09 455 ctl,
690dd9ce04f6a1 Nuno Sá 2019-10-09 456 &axi_chip_info,
690dd9ce04f6a1 Nuno Sá 2019-10-09 457 NULL);
690dd9ce04f6a1 Nuno Sá 2019-10-09 458
690dd9ce04f6a1 Nuno Sá 2019-10-09 459 return PTR_ERR_OR_ZERO(ctl->hdev);
690dd9ce04f6a1 Nuno Sá 2019-10-09 460 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[sashal-linux-stable:queue-4.9 37/96] drivers/crypto/atmel-aes.c:944 atmel_aes_ctr_transfer() warn: right shifting more than type allows 16 vs 16
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git queue-4.9
head: 89d815750d288127abb27eedf62fb7606c59cd69
commit: 5f5295e65a5cd95f1c9c208547be07a5bb0ec6c5 [37/96] crypto: atmel-aes - Fix counter overflow in CTR mode
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/crypto/atmel-aes.c:944 atmel_aes_ctr_transfer() warn: right shifting more than type allows 16 vs 16
# https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git/c...
git remote add sashal-linux-stable https://git.kernel.org/pub/scm/linux/kernel/git/sashal/linux-stable.git
git remote update sashal-linux-stable
git checkout 5f5295e65a5cd95f1c9c208547be07a5bb0ec6c5
vim +944 drivers/crypto/atmel-aes.c
fcac83656a3e3b Cyrille Pitchen 2015-12-17 920 static int atmel_aes_ctr_transfer(struct atmel_aes_dev *dd)
fcac83656a3e3b Cyrille Pitchen 2015-12-17 921 {
fcac83656a3e3b Cyrille Pitchen 2015-12-17 922 struct atmel_aes_ctr_ctx *ctx = atmel_aes_ctr_ctx_cast(dd->ctx);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 923 struct ablkcipher_request *req = ablkcipher_request_cast(dd->areq);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 924 struct scatterlist *src, *dst;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 925 size_t datalen;
5f5295e65a5cd9 Tudor Ambarus 2019-12-05 926 u32 ctr;
5f5295e65a5cd9 Tudor Ambarus 2019-12-05 927 u16 blocks, start, end;
^^^^^^^^^^
fcac83656a3e3b Cyrille Pitchen 2015-12-17 928 bool use_dma, fragmented = false;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 929
fcac83656a3e3b Cyrille Pitchen 2015-12-17 930 /* Check for transfer completion. */
fcac83656a3e3b Cyrille Pitchen 2015-12-17 931 ctx->offset += dd->total;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 932 if (ctx->offset >= req->nbytes)
fcac83656a3e3b Cyrille Pitchen 2015-12-17 933 return atmel_aes_transfer_complete(dd);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 934
fcac83656a3e3b Cyrille Pitchen 2015-12-17 935 /* Compute data length. */
fcac83656a3e3b Cyrille Pitchen 2015-12-17 936 datalen = req->nbytes - ctx->offset;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 937 blocks = DIV_ROUND_UP(datalen, AES_BLOCK_SIZE);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 938 ctr = be32_to_cpu(ctx->iv[3]);
5f5295e65a5cd9 Tudor Ambarus 2019-12-05 939
fcac83656a3e3b Cyrille Pitchen 2015-12-17 940 /* Check 16bit counter overflow. */
5f5295e65a5cd9 Tudor Ambarus 2019-12-05 941 start = ctr & 0xffff;
5f5295e65a5cd9 Tudor Ambarus 2019-12-05 942 end = start + blocks - 1;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 943
fcac83656a3e3b Cyrille Pitchen 2015-12-17 @944 if (blocks >> 16 || end < start) {
^^^^^^^^^^^^
This is always non-zero.
fcac83656a3e3b Cyrille Pitchen 2015-12-17 945 ctr |= 0xffff;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 946 datalen = AES_BLOCK_SIZE * (0x10000 - start);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 947 fragmented = true;
fcac83656a3e3b Cyrille Pitchen 2015-12-17 948 }
5f5295e65a5cd9 Tudor Ambarus 2019-12-05 949
fcac83656a3e3b Cyrille Pitchen 2015-12-17 950 use_dma = (datalen >= ATMEL_AES_DMA_THRESHOLD);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 951
fcac83656a3e3b Cyrille Pitchen 2015-12-17 952 /* Jump to offset. */
fcac83656a3e3b Cyrille Pitchen 2015-12-17 953 src = scatterwalk_ffwd(ctx->src, req->src, ctx->offset);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 954 dst = ((req->src == req->dst) ? src :
fcac83656a3e3b Cyrille Pitchen 2015-12-17 955 scatterwalk_ffwd(ctx->dst, req->dst, ctx->offset));
fcac83656a3e3b Cyrille Pitchen 2015-12-17 956
fcac83656a3e3b Cyrille Pitchen 2015-12-17 957 /* Configure hardware. */
fcac83656a3e3b Cyrille Pitchen 2015-12-17 958 atmel_aes_write_ctrl(dd, use_dma, ctx->iv);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 959 if (unlikely(fragmented)) {
fcac83656a3e3b Cyrille Pitchen 2015-12-17 960 /*
fcac83656a3e3b Cyrille Pitchen 2015-12-17 961 * Increment the counter manually to cope with the hardware
fcac83656a3e3b Cyrille Pitchen 2015-12-17 962 * counter overflow.
fcac83656a3e3b Cyrille Pitchen 2015-12-17 963 */
fcac83656a3e3b Cyrille Pitchen 2015-12-17 964 ctx->iv[3] = cpu_to_be32(ctr);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 965 crypto_inc((u8 *)ctx->iv, AES_BLOCK_SIZE);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 966 }
fcac83656a3e3b Cyrille Pitchen 2015-12-17 967
fcac83656a3e3b Cyrille Pitchen 2015-12-17 968 if (use_dma)
fcac83656a3e3b Cyrille Pitchen 2015-12-17 969 return atmel_aes_dma_start(dd, src, dst, datalen,
fcac83656a3e3b Cyrille Pitchen 2015-12-17 970 atmel_aes_ctr_transfer);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 971
fcac83656a3e3b Cyrille Pitchen 2015-12-17 972 return atmel_aes_cpu_start(dd, src, dst, datalen,
fcac83656a3e3b Cyrille Pitchen 2015-12-17 973 atmel_aes_ctr_transfer);
fcac83656a3e3b Cyrille Pitchen 2015-12-17 974 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[rcar:gmsl/dev 23/23] lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git gmsl/dev
head: 93aef18a872beaf24093f699268e56a484e31f64
commit: 93aef18a872beaf24093f699268e56a484e31f64 [23/23] lib: vsprint debug-ptrval
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
lib/vsprintf.c:800 ptr_to_id() warn: ignoring unreachable code.
Old smatch warnings:
lib/vsprintf.c:1405 ip6_compressed_string() warn: possible spectre second half. '*p'
lib/vsprintf.c:1408 ip6_compressed_string() warn: possible spectre second half. '*p'
# https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git/commit/...
git remote add rcar https://git.kernel.org/pub/scm/linux/kernel/git/kbingham/rcar.git
git remote update rcar
git checkout 93aef18a872beaf24093f699268e56a484e31f64
vim +800 lib/vsprintf.c
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 789)
9073dac14e397f Geert Uytterhoeven 2018-10-11 790 static char *ptr_to_id(char *buf, char *end, const void *ptr,
9073dac14e397f Geert Uytterhoeven 2018-10-11 791 struct printf_spec spec)
9073dac14e397f Geert Uytterhoeven 2018-10-11 792 {
9073dac14e397f Geert Uytterhoeven 2018-10-11 793 const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
9073dac14e397f Geert Uytterhoeven 2018-10-11 794 unsigned long hashval;
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 795) int ret;
9073dac14e397f Geert Uytterhoeven 2018-10-11 796
93aef18a872bea Laurent Pinchart 2020-02-10 797 return pointer_string(buf, end, ptr, spec);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93aef18a872bea Laurent Pinchart 2020-02-10 798
9073dac14e397f Geert Uytterhoeven 2018-10-11 799 /* When debugging early boot use non-cryptographically secure hash. */
9073dac14e397f Geert Uytterhoeven 2018-10-11 @800 if (unlikely(debug_boot_weak_hash)) {
9073dac14e397f Geert Uytterhoeven 2018-10-11 801 hashval = hash_long((unsigned long)ptr, 32);
9073dac14e397f Geert Uytterhoeven 2018-10-11 802 return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 803 }
9073dac14e397f Geert Uytterhoeven 2018-10-11 804
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 805) ret = __ptr_to_hashval(ptr, &hashval);
e4dcad204d3a28 Joel Fernandes (Google 2019-11-30 806) if (ret) {
9073dac14e397f Geert Uytterhoeven 2018-10-11 807 spec.field_width = 2 * sizeof(ptr);
9073dac14e397f Geert Uytterhoeven 2018-10-11 808 /* string length must be less than default_width */
c8c3b584343cb7 Petr Mladek 2019-04-17 809 return error_string(buf, end, str, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 810 }
9073dac14e397f Geert Uytterhoeven 2018-10-11 811
9073dac14e397f Geert Uytterhoeven 2018-10-11 812 return pointer_string(buf, end, (const void *)hashval, spec);
9073dac14e397f Geert Uytterhoeven 2018-10-11 813 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year
[mkl-can-next:v5.4/mcp25xxfd 5/99] drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c:1305 mcp25xxfd_irq() warn: ignoring unreachable code.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git v5.4/mcp25xxfd
head: cdcc21e4acc1a753bc4fb151b938ba292ecf686b
commit: 6499ad52b2ad766769d55b8d59df0d36db848e95 [5/99] can: mcp25xxfd: initial commit
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c:1305 mcp25xxfd_irq() warn: ignoring unreachable code.
Old smatch warnings:
drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c:1667 mcp25xxfd_probe() warn: passing zero to 'PTR_ERR'
drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c:1675 mcp25xxfd_probe() warn: passing zero to 'PTR_ERR'
# https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/co...
git remote add mkl-can-next https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
git remote update mkl-can-next
git checkout 6499ad52b2ad766769d55b8d59df0d36db848e95
vim +1305 drivers/net/can/spi/mcp25xxfd/mcp25xxfd-core.c
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1280
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1281 if (IS_ENABLED(CONFIG_CAN_MCP25XXFD_DEBUG) &&
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1282 intf_pending & ~(MCP25XXFD_CAN_INT_MODIF |
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1283 MCP25XXFD_CAN_INT_TEFIF |
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1284 MCP25XXFD_CAN_INT_RXIF |
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1285 MCP25XXFD_CAN_INT_SERRIF |
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1286 MCP25XXFD_CAN_INT_IVMIF)) {
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1287 netdev_err(priv->ndev, "%s: intf_pending=0x%04x\n",
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1288 __func__, intf_pending);
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1289 mcp25xxfd_dump(priv);
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1290 }
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1291
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1292 /* ACK interrupts that need to be ACKed in the
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1293 * MCP25XXFD_CAN_INT register.
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1294 */
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1295 intf_pending_clearable = intf_pending &
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1296 MCP25XXFD_CAN_INT_INTERRUPT_CLEARABLE;
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1297 if (intf_pending_clearable) {
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1298 err = regmap_update_bits(priv->map, MCP25XXFD_CAN_INT,
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1299 intf_pending_clearable, 0x0);
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1300 if (err)
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1301 goto out_fail;
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1302 }
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1303 } while (1);
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1304
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 @1305 return handled;
I guess the while (1) loop has no breaks.
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1306
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1307 out_fail:
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1308 mcp25xxfd_dump(priv);
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1309 mcp25xxfd_chip_interrupts_disable(priv);
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1310
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1311 return handled;
6499ad52b2ad76 Marc Kleine-Budde 2019-10-14 1312 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year