arch/mips/n64/init.c:57:38: sparse: sparse: incorrect type in argument 2 (different address spaces)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 348949d9a4440abdab3b1dc99a9bb660e8c7da7c
commit: baec970aa5ba11099ad7a91773350c91fb2113f0 mips: Add N64 machine type
date: 9 months ago
config: mips-randconfig-s032-20211014 (attached as .config)
compiler: mips-linux-gcc (GCC) 11.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.4-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout baec970aa5ba11099ad7a91773350c91fb2113f0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
command-line: note: in included file:
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQUIRE redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_SEQ_CST redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_ACQ_REL redefined
builtin:0:0: sparse: this was the original definition
builtin:1:9: sparse: sparse: preprocessor token __ATOMIC_RELEASE redefined
builtin:0:0: sparse: this was the original definition
>> arch/mips/n64/init.c:57:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@ expected void volatile [noderef] __iomem *mem @@ got unsigned int [usertype] * @@
arch/mips/n64/init.c:57:38: sparse: expected void volatile [noderef] __iomem *mem
arch/mips/n64/init.c:57:38: sparse: got unsigned int [usertype] *
vim +57 arch/mips/n64/init.c
54
55 static void __init n64rdp_write_reg(const u8 reg, const u32 value)
56 {
> 57 __raw_writel(value, REG_BASE + reg);
58 }
59
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [V4] venus: vdec: decoded picture buffer handling during reconfig sequence
by kernel test robot
Hi Mansur,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on next-20211013]
[also build test ERROR on v5.15-rc5]
[cannot apply to media-tree/master v5.15-rc5 v5.15-rc4 v5.15-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Mansur-Alisha-Shaik/venus-vdec-d...
base: 8006b911c90a4ec09958447d24c8a4c3538f5723
config: arm64-randconfig-r006-20211014 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/168172cb6c2fae8b603221ca11142de23...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Mansur-Alisha-Shaik/venus-vdec-decoded-picture-buffer-handling-during-reconfig-sequence/20211014-121505
git checkout 168172cb6c2fae8b603221ca11142de23a40f980
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
drivers/media/platform/qcom/venus/vdec.c: In function 'vdec_buf_done':
>> drivers/media/platform/qcom/venus/vdec.c:1331:17: error: implicit declaration of function 'venus_helper_change_dpb_buf_owner'; did you mean 'venus_helper_change_dpb_owner'? [-Werror=implicit-function-declaration]
1331 | venus_helper_change_dpb_buf_owner(inst, vbuf, type, buf_type, tag);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| venus_helper_change_dpb_owner
drivers/media/platform/qcom/venus/vdec.c:1320:24: warning: unused variable 'dpb_buf' [-Wunused-variable]
1320 | struct intbuf *dpb_buf;
| ^~~~~~~
cc1: some warnings being treated as errors
vim +1331 drivers/media/platform/qcom/venus/vdec.c
1311
1312 static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
1313 u32 tag, u32 bytesused, u32 data_offset, u32 flags,
1314 u32 hfi_flags, u64 timestamp_us)
1315 {
1316 enum vb2_buffer_state state = VB2_BUF_STATE_DONE;
1317 struct vb2_v4l2_buffer *vbuf;
1318 struct vb2_buffer *vb;
1319 unsigned int type;
1320 struct intbuf *dpb_buf;
1321
1322 vdec_pm_touch(inst);
1323
1324 if (buf_type == HFI_BUFFER_INPUT)
1325 type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
1326 else
1327 type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
1328
1329 vbuf = venus_helper_find_buf(inst, type, tag);
1330 if (!vbuf) {
> 1331 venus_helper_change_dpb_buf_owner(inst, vbuf, type, buf_type, tag);
1332 return;
1333 }
1334
1335 vbuf->flags = flags;
1336 vbuf->field = V4L2_FIELD_NONE;
1337 vb = &vbuf->vb2_buf;
1338
1339 if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
1340 vb2_set_plane_payload(vb, 0, bytesused);
1341 vb->planes[0].data_offset = data_offset;
1342 vb->timestamp = timestamp_us * NSEC_PER_USEC;
1343 vbuf->sequence = inst->sequence_cap++;
1344
1345 if (vbuf->flags & V4L2_BUF_FLAG_LAST) {
1346 const struct v4l2_event ev = { .type = V4L2_EVENT_EOS };
1347
1348 v4l2_event_queue_fh(&inst->fh, &ev);
1349
1350 if (inst->codec_state == VENUS_DEC_STATE_DRAIN) {
1351 inst->drain_active = false;
1352 inst->codec_state = VENUS_DEC_STATE_STOPPED;
1353 }
1354 }
1355
1356 if (!bytesused)
1357 state = VB2_BUF_STATE_ERROR;
1358 } else {
1359 vbuf->sequence = inst->sequence_out++;
1360 }
1361
1362 venus_helper_get_ts_metadata(inst, timestamp_us, vbuf);
1363
1364 if (hfi_flags & HFI_BUFFERFLAG_READONLY)
1365 venus_helper_acquire_buf_ref(vbuf);
1366
1367 if (hfi_flags & HFI_BUFFERFLAG_DATACORRUPT)
1368 state = VB2_BUF_STATE_ERROR;
1369
1370 if (hfi_flags & HFI_BUFFERFLAG_DROP_FRAME) {
1371 state = VB2_BUF_STATE_ERROR;
1372 vb2_set_plane_payload(vb, 0, 0);
1373 vb->timestamp = 0;
1374 }
1375
1376 v4l2_m2m_buf_done(vbuf, state);
1377 }
1378
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH net-next] tcp: switch orphan_count to bare per-cpu counters
by kernel test robot
Hi Eric,
I love your patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/Eric-Dumazet/tcp-switch-orphan_c...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 39e222bfd7f37e7a98069869375b903d7096c113
config: microblaze-buildonly-randconfig-r004-20211013 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/890c055a0e11b7505283aa06a63f04cbf...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Eric-Dumazet/tcp-switch-orphan_count-to-bare-per-cpu-counters/20211014-102939
git checkout 890c055a0e11b7505283aa06a63f04cbf7e115f0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
In file included from drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c:33:
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c: In function 'reset_listen_child':
>> drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h:98:62: error: passing argument 1 of 'percpu_counter_inc' from incompatible pointer type [-Werror=incompatible-pointer-types]
98 | #define INC_ORPHAN_COUNT(sk) percpu_counter_inc((sk)->sk_prot->orphan_count)
| ~~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| unsigned int *
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c:508:9: note: in expansion of macro 'INC_ORPHAN_COUNT'
508 | INC_ORPHAN_COUNT(child);
| ^~~~~~~~~~~~~~~~
In file included from include/linux/sched/user.h:7,
from include/linux/cred.h:17,
from include/linux/sched/signal.h:10,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/highmem.h:5,
from include/linux/bvec.h:10,
from include/linux/skbuff.h:17,
from drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c:11:
include/linux/percpu_counter.h:181:62: note: expected 'struct percpu_counter *' but argument is of type 'unsigned int *'
181 | static inline void percpu_counter_inc(struct percpu_counter *fbc)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c: In function 'do_abort_syn_rcv':
>> drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c:873:52: error: passing argument 1 of 'percpu_counter_inc' from incompatible pointer type [-Werror=incompatible-pointer-types]
873 | percpu_counter_inc((child)->sk_prot->orphan_count);
| ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
| |
| unsigned int *
In file included from include/linux/sched/user.h:7,
from include/linux/cred.h:17,
from include/linux/sched/signal.h:10,
from include/linux/rcuwait.h:6,
from include/linux/percpu-rwsem.h:7,
from include/linux/fs.h:33,
from include/linux/highmem.h:5,
from include/linux/bvec.h:10,
from include/linux/skbuff.h:17,
from drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c:11:
include/linux/percpu_counter.h:181:62: note: expected 'struct percpu_counter *' but argument is of type 'unsigned int *'
181 | static inline void percpu_counter_inc(struct percpu_counter *fbc)
| ~~~~~~~~~~~~~~~~~~~~~~~^~~
cc1: some warnings being treated as errors
vim +/percpu_counter_inc +98 drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.h
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 90
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 91 #define SND_WSCALE(tp) ((tp)->rx_opt.snd_wscale)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 92 #define RCV_WSCALE(tp) ((tp)->rx_opt.rcv_wscale)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 93 #define USER_MSS(tp) ((tp)->rx_opt.user_mss)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 94 #define TS_RECENT_STAMP(tp) ((tp)->rx_opt.ts_recent_stamp)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 95 #define WSCALE_OK(tp) ((tp)->rx_opt.wscale_ok)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 96 #define TSTAMP_OK(tp) ((tp)->rx_opt.tstamp_ok)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 97 #define SACK_OK(tp) ((tp)->rx_opt.sack_ok)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 @98 #define INC_ORPHAN_COUNT(sk) percpu_counter_inc((sk)->sk_prot->orphan_count)
a6779341a173aa drivers/crypto/chelsio/chtls/chtls_cm.h Atul Gupta 2018-03-31 99
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
Re: [PATCH net-next v2] mctp: Implement extended addressing
by kernel test robot
Hi Jeremy,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Jeremy-Kerr/mctp-Implement-exten...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 39e222bfd7f37e7a98069869375b903d7096c113
config: hexagon-randconfig-r041-20211014 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 6c76d0101193aa4eb891a6954ff047eda2f9cf71)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/2fed3ce68e4fc1a6f8faaa838ce84829c...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jeremy-Kerr/mctp-Implement-extended-addressing/20211014-103942
git checkout 2fed3ce68e4fc1a6f8faaa838ce84829cd030f6b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=hexagon
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> net/mctp/route.c:752:7: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (WARN_ON(!rt->dev))
^~~~~~~~~~~~~~~~~
include/asm-generic/bug.h:120:28: note: expanded from macro 'WARN_ON'
#define WARN_ON(condition) ({ \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
net/mctp/route.c:838:9: note: uninitialized use occurs here
return rc;
^~
net/mctp/route.c:752:3: note: remove the 'if' if its condition is always false
if (WARN_ON(!rt->dev))
^~~~~~~~~~~~~~~~~~~~~~
net/mctp/route.c:745:8: note: initialize the variable 'rc' to silence this warning
int rc;
^
= 0
1 warning generated.
vim +752 net/mctp/route.c
4a992bbd365094 Jeremy Kerr 2021-07-29 732
889b7da23abf92 Jeremy Kerr 2021-07-29 733 int mctp_local_output(struct sock *sk, struct mctp_route *rt,
889b7da23abf92 Jeremy Kerr 2021-07-29 734 struct sk_buff *skb, mctp_eid_t daddr, u8 req_tag)
889b7da23abf92 Jeremy Kerr 2021-07-29 735 {
833ef3b91de692 Jeremy Kerr 2021-07-29 736 struct mctp_sock *msk = container_of(sk, struct mctp_sock, sk);
889b7da23abf92 Jeremy Kerr 2021-07-29 737 struct mctp_skb_cb *cb = mctp_cb(skb);
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 738 struct mctp_route tmp_rt;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 739 struct net_device *dev;
889b7da23abf92 Jeremy Kerr 2021-07-29 740 struct mctp_hdr *hdr;
889b7da23abf92 Jeremy Kerr 2021-07-29 741 unsigned long flags;
4a992bbd365094 Jeremy Kerr 2021-07-29 742 unsigned int mtu;
889b7da23abf92 Jeremy Kerr 2021-07-29 743 mctp_eid_t saddr;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 744 bool ext_rt;
889b7da23abf92 Jeremy Kerr 2021-07-29 745 int rc;
833ef3b91de692 Jeremy Kerr 2021-07-29 746 u8 tag;
889b7da23abf92 Jeremy Kerr 2021-07-29 747
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 748 if (rt) {
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 749 ext_rt = false;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 750 dev = NULL;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 751
889b7da23abf92 Jeremy Kerr 2021-07-29 @752 if (WARN_ON(!rt->dev))
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 753 goto out_release;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 754
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 755 } else if (cb->ifindex) {
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 756 ext_rt = true;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 757 rt = &tmp_rt;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 758
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 759 rc = -ENODEV;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 760 rcu_read_lock();
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 761 dev = dev_get_by_index_rcu(sock_net(sk), cb->ifindex);
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 762 if (!dev) {
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 763 rcu_read_unlock();
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 764 return rc;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 765 }
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 766
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 767 rt->dev = __mctp_dev_get(dev);
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 768 rcu_read_unlock();
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 769
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 770 if (!rt->dev)
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 771 goto out_release;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 772
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 773 /* establish temporary route - we set up enough to keep
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 774 * mctp_route_output happy
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 775 */
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 776 rt->output = mctp_route_output;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 777 rt->mtu = 0;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 778
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 779 } else {
889b7da23abf92 Jeremy Kerr 2021-07-29 780 return -EINVAL;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 781 }
889b7da23abf92 Jeremy Kerr 2021-07-29 782
889b7da23abf92 Jeremy Kerr 2021-07-29 783 spin_lock_irqsave(&rt->dev->addrs_lock, flags);
889b7da23abf92 Jeremy Kerr 2021-07-29 784 if (rt->dev->num_addrs == 0) {
889b7da23abf92 Jeremy Kerr 2021-07-29 785 rc = -EHOSTUNREACH;
889b7da23abf92 Jeremy Kerr 2021-07-29 786 } else {
889b7da23abf92 Jeremy Kerr 2021-07-29 787 /* use the outbound interface's first address as our source */
889b7da23abf92 Jeremy Kerr 2021-07-29 788 saddr = rt->dev->addrs[0];
889b7da23abf92 Jeremy Kerr 2021-07-29 789 rc = 0;
889b7da23abf92 Jeremy Kerr 2021-07-29 790 }
889b7da23abf92 Jeremy Kerr 2021-07-29 791 spin_unlock_irqrestore(&rt->dev->addrs_lock, flags);
889b7da23abf92 Jeremy Kerr 2021-07-29 792
889b7da23abf92 Jeremy Kerr 2021-07-29 793 if (rc)
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 794 goto out_release;
889b7da23abf92 Jeremy Kerr 2021-07-29 795
833ef3b91de692 Jeremy Kerr 2021-07-29 796 if (req_tag & MCTP_HDR_FLAG_TO) {
833ef3b91de692 Jeremy Kerr 2021-07-29 797 rc = mctp_alloc_local_tag(msk, saddr, daddr, &tag);
833ef3b91de692 Jeremy Kerr 2021-07-29 798 if (rc)
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 799 goto out_release;
833ef3b91de692 Jeremy Kerr 2021-07-29 800 tag |= MCTP_HDR_FLAG_TO;
833ef3b91de692 Jeremy Kerr 2021-07-29 801 } else {
833ef3b91de692 Jeremy Kerr 2021-07-29 802 tag = req_tag;
833ef3b91de692 Jeremy Kerr 2021-07-29 803 }
833ef3b91de692 Jeremy Kerr 2021-07-29 804
4a992bbd365094 Jeremy Kerr 2021-07-29 805 skb->protocol = htons(ETH_P_MCTP);
4a992bbd365094 Jeremy Kerr 2021-07-29 806 skb->priority = 0;
889b7da23abf92 Jeremy Kerr 2021-07-29 807 skb_reset_transport_header(skb);
889b7da23abf92 Jeremy Kerr 2021-07-29 808 skb_push(skb, sizeof(struct mctp_hdr));
889b7da23abf92 Jeremy Kerr 2021-07-29 809 skb_reset_network_header(skb);
4a992bbd365094 Jeremy Kerr 2021-07-29 810 skb->dev = rt->dev->dev;
4a992bbd365094 Jeremy Kerr 2021-07-29 811
4a992bbd365094 Jeremy Kerr 2021-07-29 812 /* cb->net will have been set on initial ingress */
4a992bbd365094 Jeremy Kerr 2021-07-29 813 cb->src = saddr;
4a992bbd365094 Jeremy Kerr 2021-07-29 814
4a992bbd365094 Jeremy Kerr 2021-07-29 815 /* set up common header fields */
889b7da23abf92 Jeremy Kerr 2021-07-29 816 hdr = mctp_hdr(skb);
889b7da23abf92 Jeremy Kerr 2021-07-29 817 hdr->ver = 1;
889b7da23abf92 Jeremy Kerr 2021-07-29 818 hdr->dest = daddr;
889b7da23abf92 Jeremy Kerr 2021-07-29 819 hdr->src = saddr;
889b7da23abf92 Jeremy Kerr 2021-07-29 820
4a992bbd365094 Jeremy Kerr 2021-07-29 821 mtu = mctp_route_mtu(rt);
889b7da23abf92 Jeremy Kerr 2021-07-29 822
4a992bbd365094 Jeremy Kerr 2021-07-29 823 if (skb->len + sizeof(struct mctp_hdr) <= mtu) {
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 824 hdr->flags_seq_tag = MCTP_HDR_FLAG_SOM |
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 825 MCTP_HDR_FLAG_EOM | tag;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 826 rc = rt->output(rt, skb);
4a992bbd365094 Jeremy Kerr 2021-07-29 827 } else {
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 828 rc = mctp_do_fragment_route(rt, skb, mtu, tag);
4a992bbd365094 Jeremy Kerr 2021-07-29 829 }
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 830
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 831 out_release:
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 832 if (!ext_rt)
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 833 mctp_route_release(rt);
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 834
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 835 if (dev)
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 836 dev_put(dev);
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 837
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 838 return rc;
2fed3ce68e4fc1 Jeremy Kerr 2021-10-14 839
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week
[kbuild] Re: [PATCH] ASoC: soc-compress: prevent the potentially use of null pointer
by Dan Carpenter
Hi Jiasheng,
url: https://github.com/0day-ci/linux/commits/Jiasheng-Jiang/ASoC-soc-compress...
base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next
config: i386-randconfig-m021-20211013 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
sound/soc/soc-compress.c:595 snd_soc_new_compress() error: we previously assumed 'codec_dai' could be null (see line 538)
vim +/codec_dai +595 sound/soc/soc-compress.c
6f0c42269f000b Jie Yang 2015-10-13 511 int snd_soc_new_compress(struct snd_soc_pcm_runtime *rtd, int num)
1245b7005de02d Namarta Kohli 2012-08-16 512 {
9e7e3738ab0e90 Kuninori Morimoto 2017-10-11 513 struct snd_soc_component *component;
c2233a266178f8 Kuninori Morimoto 2020-03-30 514 struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0);
c2233a266178f8 Kuninori Morimoto 2020-03-30 515 struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
1245b7005de02d Namarta Kohli 2012-08-16 516 struct snd_compr *compr;
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 517 struct snd_pcm *be_pcm;
1245b7005de02d Namarta Kohli 2012-08-16 518 char new_name[64];
1245b7005de02d Namarta Kohli 2012-08-16 519 int ret = 0, direction = 0;
a1068045883ed4 Vinod Koul 2016-01-07 520 int playback = 0, capture = 0;
613fb50059cf19 Kuninori Morimoto 2020-01-10 521 int i;
1245b7005de02d Namarta Kohli 2012-08-16 522
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 523 /*
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 524 * make sure these are same value,
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 525 * and then use these as equally
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 526 */
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 527 BUILD_BUG_ON((int)SNDRV_PCM_STREAM_PLAYBACK != (int)SND_COMPRESS_PLAYBACK);
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 528 BUILD_BUG_ON((int)SNDRV_PCM_STREAM_CAPTURE != (int)SND_COMPRESS_CAPTURE);
7428d8c8bd7936 Kuninori Morimoto 2020-10-30 529
6e1276a5e613d2 Bard Liao 2020-02-25 530 if (rtd->num_cpus > 1 ||
6e1276a5e613d2 Bard Liao 2020-02-25 531 rtd->num_codecs > 1) {
141dfc9e3751f5 Charles Keepax 2018-01-26 532 dev_err(rtd->card->dev,
6e1276a5e613d2 Bard Liao 2020-02-25 533 "Compress ASoC: Multi CPU/Codec not supported\n");
8151d5e60232d3 Benoit Cousson 2014-07-08 534 return -EINVAL;
8151d5e60232d3 Benoit Cousson 2014-07-08 535 }
8151d5e60232d3 Benoit Cousson 2014-07-08 536
1245b7005de02d Namarta Kohli 2012-08-16 537 /* check client and interface hw capabilities */
87e5451ef9ec85 Jiasheng Jiang 2021-10-13 @538 if (codec_dai && cpu_dai) {
^^^^^^^^^
Can this really be NULL?
467fece8fbc677 Kuninori Morimoto 2019-07-22 539 if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_PLAYBACK) &&
467fece8fbc677 Kuninori Morimoto 2019-07-22 540 snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_PLAYBACK))
a1068045883ed4 Vinod Koul 2016-01-07 541 playback = 1;
467fece8fbc677 Kuninori Morimoto 2019-07-22 542 if (snd_soc_dai_stream_valid(codec_dai, SNDRV_PCM_STREAM_CAPTURE) &&
467fece8fbc677 Kuninori Morimoto 2019-07-22 543 snd_soc_dai_stream_valid(cpu_dai, SNDRV_PCM_STREAM_CAPTURE))
a1068045883ed4 Vinod Koul 2016-01-07 544 capture = 1;
87e5451ef9ec85 Jiasheng Jiang 2021-10-13 545 }
a1068045883ed4 Vinod Koul 2016-01-07 546
a1068045883ed4 Vinod Koul 2016-01-07 547 /*
a1068045883ed4 Vinod Koul 2016-01-07 548 * Compress devices are unidirectional so only one of the directions
a1068045883ed4 Vinod Koul 2016-01-07 549 * should be set, check for that (xor)
a1068045883ed4 Vinod Koul 2016-01-07 550 */
a1068045883ed4 Vinod Koul 2016-01-07 551 if (playback + capture != 1) {
141dfc9e3751f5 Charles Keepax 2018-01-26 552 dev_err(rtd->card->dev,
141dfc9e3751f5 Charles Keepax 2018-01-26 553 "Compress ASoC: Invalid direction for P %d, C %d\n",
a1068045883ed4 Vinod Koul 2016-01-07 554 playback, capture);
a1068045883ed4 Vinod Koul 2016-01-07 555 return -EINVAL;
a1068045883ed4 Vinod Koul 2016-01-07 556 }
a1068045883ed4 Vinod Koul 2016-01-07 557
a1068045883ed4 Vinod Koul 2016-01-07 558 if (playback)
1245b7005de02d Namarta Kohli 2012-08-16 559 direction = SND_COMPRESS_PLAYBACK;
daa2db59ce7e36 Charles Keepax 2013-04-18 560 else
a1068045883ed4 Vinod Koul 2016-01-07 561 direction = SND_COMPRESS_CAPTURE;
daa2db59ce7e36 Charles Keepax 2013-04-18 562
09f448a415ece4 Amadeusz Sławiński 2019-06-17 563 compr = devm_kzalloc(rtd->card->dev, sizeof(*compr), GFP_KERNEL);
7a0cf42edd9cc3 Markus Elfring 2017-08-10 564 if (!compr)
1245b7005de02d Namarta Kohli 2012-08-16 565 return -ENOMEM;
1245b7005de02d Namarta Kohli 2012-08-16 566
1f88eb0f0660f8 Charles Keepax 2013-02-05 567 compr->ops = devm_kzalloc(rtd->card->dev, sizeof(soc_compr_ops),
1f88eb0f0660f8 Charles Keepax 2013-02-05 568 GFP_KERNEL);
09f448a415ece4 Amadeusz Sławiński 2019-06-17 569 if (!compr->ops)
09f448a415ece4 Amadeusz Sławiński 2019-06-17 570 return -ENOMEM;
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 571
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 572 if (rtd->dai_link->dynamic) {
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 573 snprintf(new_name, sizeof(new_name), "(%s)",
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 574 rtd->dai_link->stream_name);
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 575
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 576 ret = snd_pcm_new_internal(rtd->card->snd_card, new_name, num,
d3268a40d4b19f Qais Yousef 2015-01-14 577 rtd->dai_link->dpcm_playback,
d3268a40d4b19f Qais Yousef 2015-01-14 578 rtd->dai_link->dpcm_capture, &be_pcm);
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 579 if (ret < 0) {
141dfc9e3751f5 Charles Keepax 2018-01-26 580 dev_err(rtd->card->dev,
141dfc9e3751f5 Charles Keepax 2018-01-26 581 "Compress ASoC: can't create compressed for %s: %d\n",
141dfc9e3751f5 Charles Keepax 2018-01-26 582 rtd->dai_link->name, ret);
09f448a415ece4 Amadeusz Sławiński 2019-06-17 583 return ret;
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 584 }
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 585
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 586 rtd->pcm = be_pcm;
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 587 rtd->fe_compr = 1;
d3268a40d4b19f Qais Yousef 2015-01-14 588 if (rtd->dai_link->dpcm_playback)
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 589 be_pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream->private_data = rtd;
d3268a40d4b19f Qais Yousef 2015-01-14 590 else if (rtd->dai_link->dpcm_capture)
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 591 be_pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream->private_data = rtd;
2a99ef0fdb35a0 Liam Girdwood 2014-01-17 592 memcpy(compr->ops, &soc_compr_dyn_ops, sizeof(soc_compr_dyn_ops));
aeb6fa0f15c71a Peng Donglin 2017-08-16 593 } else {
aeb6fa0f15c71a Peng Donglin 2017-08-16 594 snprintf(new_name, sizeof(new_name), "%s %s-%d",
aeb6fa0f15c71a Peng Donglin 2017-08-16 @595 rtd->dai_link->stream_name, codec_dai->name, num);
^^^^^^^^^^^^^^^
Other code assumes that it is non-NULL and doesn't check.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave(a)lists.01.org
11 months, 1 week
Re: [PATCH 2/2] [v19 2/2] wireless: Initial driver submission for pureLiFi STA devices
by kernel test robot
Hi Srinivasan,
I love your patch! Perhaps something to improve:
[auto build test WARNING on kvalo-wireless-drivers-next/master]
[also build test WARNING on kvalo-wireless-drivers/master jberg-mac80211-next/master jberg-mac80211/master v5.15-rc5 next-20211013]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Srinivasan-Raju/nl80211-Add-LC-p...
base: https://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-ne... master
config: x86_64-allmodconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/0day-ci/linux/commit/7a077cc97d6f22264e6c9ac98d9e904ca...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Srinivasan-Raju/nl80211-Add-LC-placeholder-band-definition-to-enum-nl80211_band/20211012-215200
git checkout 7a077cc97d6f22264e6c9ac98d9e904ca908ccba
# save the attached .config to linux build tree
make W=1 ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/net/wireless/purelifi/plfxlc/mac.c: In function 'purelifi_mac_rx':
>> drivers/net/wireless/purelifi/plfxlc/mac.c:424:28: warning: variable 'min_exp_seq_nmb' set but not used [-Wunused-but-set-variable]
424 | static unsigned short int min_exp_seq_nmb;
| ^~~~~~~~~~~~~~~
vim +/min_exp_seq_nmb +424 drivers/net/wireless/purelifi/plfxlc/mac.c
412
413 int purelifi_mac_rx(struct ieee80211_hw *hw, const u8 *buffer,
414 unsigned int length)
415 {
416 struct purelifi_mac *mac = purelifi_hw_mac(hw);
417 struct ieee80211_rx_status stats;
418 const struct rx_status *status;
419 struct sk_buff *skb;
420 int bad_frame = 0;
421 __le16 fc;
422 int need_padding;
423 unsigned int payload_length;
> 424 static unsigned short int min_exp_seq_nmb;
425 int sidx;
426 struct purelifi_usb_tx *tx;
427 /* Packet blockade during disabled interface. */
428 if (!mac->vif)
429 return 0;
430
431 memset(&stats, 0, sizeof(stats));
432 status = (struct rx_status *)buffer;
433
434 stats.flag = 0;
435 stats.freq = 2412;
436 stats.band = NL80211_BAND_LC;
437 mac->rssi = -15 * be16_to_cpu(status->rssi) / 10;
438
439 stats.signal = mac->rssi;
440
441 if (status->rate_idx > 7)
442 stats.rate_idx = 0;
443 else
444 stats.rate_idx = status->rate_idx;
445
446 mac->crc_errors = be64_to_cpu(status->crc_error_count);
447
448 if (!bad_frame &&
449 purelifi_filter_ack(hw, (struct ieee80211_hdr *)buffer, &stats) &&
450 !mac->pass_ctrl)
451 return 0;
452
453 buffer += sizeof(struct rx_status);
454 payload_length = get_unaligned_be32(buffer);
455
456 /* MTU = 1500, MAC header = 36, CRC = 4, sum = 1540 */
457 if (payload_length > 1560) {
458 dev_err(purelifi_mac_dev(mac), " > MTU %u\n", payload_length);
459 return 0;
460 }
461 buffer += sizeof(u32);
462
463 fc = get_unaligned((__le16 *)buffer);
464 need_padding = ieee80211_is_data_qos(fc) ^ ieee80211_has_a4(fc);
465
466 tx = &mac->chip.usb.tx;
467
468 for (sidx = 0; sidx < MAX_STA_NUM - 1; sidx++) {
469 if (memcmp(&buffer[10], tx->station[sidx].mac, ETH_ALEN))
470 continue;
471 if (tx->station[sidx].flag & STATION_CONNECTED_FLAG) {
472 tx->station[sidx].flag |= STATION_HEARTBEAT_FLAG;
473 break;
474 }
475 }
476
477 if (sidx == MAX_STA_NUM - 1) {
478 for (sidx = 0; sidx < MAX_STA_NUM - 1; sidx++) {
479 if (tx->station[sidx].flag & STATION_CONNECTED_FLAG)
480 continue;
481 memcpy(tx->station[sidx].mac, &buffer[10], ETH_ALEN);
482 tx->station[sidx].flag |= STATION_CONNECTED_FLAG;
483 tx->station[sidx].flag |= STATION_HEARTBEAT_FLAG;
484 break;
485 }
486 }
487
488 switch (buffer[0]) {
489 case IEEE80211_STYPE_PROBE_REQ:
490 dev_dbg(purelifi_mac_dev(mac), "Probe request\n");
491 break;
492 case IEEE80211_STYPE_ASSOC_REQ:
493 dev_dbg(purelifi_mac_dev(mac), "Association request\n");
494 break;
495 case IEEE80211_STYPE_AUTH:
496 dev_dbg(purelifi_mac_dev(mac), "Authentication req\n");
497 min_exp_seq_nmb = 0;
498 break;
499 case IEEE80211_FTYPE_DATA:
500 dev_dbg(purelifi_mac_dev(mac), "802.11 data frame\n");
501 break;
502 }
503
504 skb = dev_alloc_skb(payload_length + (need_padding ? 2 : 0));
505 if (!skb)
506 return -ENOMEM;
507
508 if (need_padding)
509 /* Make sure that the payload data is 4 byte aligned. */
510 skb_reserve(skb, 2);
511
512 skb_put_data(skb, buffer, payload_length);
513 memcpy(IEEE80211_SKB_RXCB(skb), &stats, sizeof(stats));
514 ieee80211_rx_irqsafe(hw, skb);
515 return 0;
516 }
517
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
11 months, 1 week