drivers/usb/serial/ir-usb.c:305 ir_write() error: double unlocked 'port->lock' (orig line 279)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Johan Hovold <johan(a)kernel.org>
CC: "Greg Kroah-Hartman" <gregkh(a)linuxfoundation.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b51594df17d0ce80b9f9f35394a1f42d7ac94472
commit: 38c0d5bdf4973f9f5a888166e9d3e9ed0d32057a USB: serial: ir-usb: fix IrLAP framing
date: 7 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 7 months ago
config: h8300-randconfig-m031-20200831 (attached as .config)
compiler: h8300-linux-gcc (GCC) 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:
drivers/usb/serial/ir-usb.c:305 ir_write() error: double unlocked 'port->lock' (orig line 279)
# 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 38c0d5bdf4973f9f5a888166e9d3e9ed0d32057a
vim +305 drivers/usb/serial/ir-usb.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 258
38c0d5bdf4973f Johan Hovold 2020-01-22 259 static int ir_write(struct tty_struct *tty, struct usb_serial_port *port,
38c0d5bdf4973f Johan Hovold 2020-01-22 260 const unsigned char *buf, int count)
^1da177e4c3f41 Linus Torvalds 2005-04-16 261 {
38c0d5bdf4973f Johan Hovold 2020-01-22 262 struct urb *urb = NULL;
38c0d5bdf4973f Johan Hovold 2020-01-22 263 unsigned long flags;
38c0d5bdf4973f Johan Hovold 2020-01-22 264 int ret;
38c0d5bdf4973f Johan Hovold 2020-01-22 265
38c0d5bdf4973f Johan Hovold 2020-01-22 266 if (port->bulk_out_size == 0)
38c0d5bdf4973f Johan Hovold 2020-01-22 267 return -EINVAL;
^1da177e4c3f41 Linus Torvalds 2005-04-16 268
38c0d5bdf4973f Johan Hovold 2020-01-22 269 if (count == 0)
38c0d5bdf4973f Johan Hovold 2020-01-22 270 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 271
38c0d5bdf4973f Johan Hovold 2020-01-22 272 count = min(count, port->bulk_out_size - 1);
38c0d5bdf4973f Johan Hovold 2020-01-22 273
38c0d5bdf4973f Johan Hovold 2020-01-22 274 spin_lock_irqsave(&port->lock, flags);
38c0d5bdf4973f Johan Hovold 2020-01-22 275 if (__test_and_clear_bit(0, &port->write_urbs_free)) {
38c0d5bdf4973f Johan Hovold 2020-01-22 276 urb = port->write_urbs[0];
38c0d5bdf4973f Johan Hovold 2020-01-22 277 port->tx_bytes += count;
^1da177e4c3f41 Linus Torvalds 2005-04-16 278 }
38c0d5bdf4973f Johan Hovold 2020-01-22 @279 spin_unlock_irqrestore(&port->lock, flags);
^1da177e4c3f41 Linus Torvalds 2005-04-16 280
38c0d5bdf4973f Johan Hovold 2020-01-22 281 if (!urb)
38c0d5bdf4973f Johan Hovold 2020-01-22 282 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 283
^1da177e4c3f41 Linus Torvalds 2005-04-16 284 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 285 * The first byte of the packet we send to the device contains an
38c0d5bdf4973f Johan Hovold 2020-01-22 286 * outbound header which indicates an additional number of BOFs and
^1da177e4c3f41 Linus Torvalds 2005-04-16 287 * a baud rate change.
^1da177e4c3f41 Linus Torvalds 2005-04-16 288 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 289 * See section 5.4.2.2 of the USB IrDA spec.
^1da177e4c3f41 Linus Torvalds 2005-04-16 290 */
38c0d5bdf4973f Johan Hovold 2020-01-22 291 *(u8 *)urb->transfer_buffer = ir_xbof | ir_baud;
38c0d5bdf4973f Johan Hovold 2020-01-22 292
38c0d5bdf4973f Johan Hovold 2020-01-22 293 memcpy(urb->transfer_buffer + 1, buf, count);
38c0d5bdf4973f Johan Hovold 2020-01-22 294
38c0d5bdf4973f Johan Hovold 2020-01-22 295 urb->transfer_buffer_length = count + 1;
38c0d5bdf4973f Johan Hovold 2020-01-22 296 urb->transfer_flags = URB_ZERO_PACKET;
38c0d5bdf4973f Johan Hovold 2020-01-22 297
38c0d5bdf4973f Johan Hovold 2020-01-22 298 ret = usb_submit_urb(urb, GFP_ATOMIC);
38c0d5bdf4973f Johan Hovold 2020-01-22 299 if (ret) {
38c0d5bdf4973f Johan Hovold 2020-01-22 300 dev_err(&port->dev, "failed to submit write urb: %d\n", ret);
38c0d5bdf4973f Johan Hovold 2020-01-22 301
38c0d5bdf4973f Johan Hovold 2020-01-22 302 spin_lock_irqsave(&port->lock, flags);
38c0d5bdf4973f Johan Hovold 2020-01-22 303 __set_bit(0, &port->write_urbs_free);
38c0d5bdf4973f Johan Hovold 2020-01-22 304 port->tx_bytes -= count;
38c0d5bdf4973f Johan Hovold 2020-01-22 @305 spin_unlock_irqrestore(&port->lock, flags);
38c0d5bdf4973f Johan Hovold 2020-01-22 306
38c0d5bdf4973f Johan Hovold 2020-01-22 307 return ret;
38c0d5bdf4973f Johan Hovold 2020-01-22 308 }
38c0d5bdf4973f Johan Hovold 2020-01-22 309
38c0d5bdf4973f Johan Hovold 2020-01-22 310 return count;
38c0d5bdf4973f Johan Hovold 2020-01-22 311 }
38c0d5bdf4973f Johan Hovold 2020-01-22 312
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
drivers/infiniband/ulp/iser/iser_memory.c:389 iser_reg_mem_fastreg() error: double unlocked 'ib_conn->fr_pool.lock' (orig line 368)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Israel Rukshin <israelr(a)mellanox.com>
CC: Jason Gunthorpe <jgg(a)mellanox.com>
CC: Max Gurtovoy <maxg(a)mellanox.com>
CC: Sagi Grimberg <sagi(a)grimberg.me>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: b51594df17d0ce80b9f9f35394a1f42d7ac94472
commit: 1fc431320a53f3e9b33b399667c8788fa00eb8b0 RDMA/iser: Remove support for FMR memory registration
date: 3 months ago
:::::: branch date: 52 minutes ago
:::::: commit date: 3 months ago
config: m68k-randconfig-m031-20200831 (attached as .config)
compiler: m68k-linux-gcc (GCC) 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:
drivers/infiniband/ulp/iser/iser_memory.c:389 iser_reg_mem_fastreg() error: double unlocked 'ib_conn->fr_pool.lock' (orig line 368)
# 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 1fc431320a53f3e9b33b399667c8788fa00eb8b0
vim +389 drivers/infiniband/ulp/iser/iser_memory.c
5587856c9659ac Sagi Grimberg 2013-07-28 352
1fc431320a53f3 Israel Rukshin 2020-05-28 353 int iser_reg_mem_fastreg(struct iscsi_iser_task *task,
b5f04b00f73d8f Jenny Derzhavetz 2015-12-09 354 enum iser_data_dir dir,
b5f04b00f73d8f Jenny Derzhavetz 2015-12-09 355 bool all_imm)
32467c420bb687 Sagi Grimberg 2015-08-06 356 {
32467c420bb687 Sagi Grimberg 2015-08-06 357 struct ib_conn *ib_conn = &task->iser_conn->ib_conn;
32467c420bb687 Sagi Grimberg 2015-08-06 358 struct iser_data_buf *mem = &task->data[dir];
32467c420bb687 Sagi Grimberg 2015-08-06 359 struct iser_mem_reg *reg = &task->rdma_reg[dir];
32467c420bb687 Sagi Grimberg 2015-08-06 360 struct iser_fr_desc *desc = NULL;
3cffd930171518 Sagi Grimberg 2015-09-24 361 bool use_dma_key;
32467c420bb687 Sagi Grimberg 2015-08-06 362 int err;
32467c420bb687 Sagi Grimberg 2015-08-06 363
b5f04b00f73d8f Jenny Derzhavetz 2015-12-09 364 use_dma_key = mem->dma_nents == 1 && (all_imm || !iser_always_reg) &&
b5f04b00f73d8f Jenny Derzhavetz 2015-12-09 365 scsi_get_prot_op(task->sc) == SCSI_PROT_NORMAL;
3cffd930171518 Sagi Grimberg 2015-09-24 366
3cffd930171518 Sagi Grimberg 2015-09-24 367 if (!use_dma_key) {
1fc431320a53f3 Israel Rukshin 2020-05-28 @368 desc = iser_reg_desc_get_fr(ib_conn);
32467c420bb687 Sagi Grimberg 2015-08-06 369 reg->mem_h = desc;
5587856c9659ac Sagi Grimberg 2013-07-28 370 }
5587856c9659ac Sagi Grimberg 2013-07-28 371
b76a439982f848 Israel Rukshin 2019-06-11 372 if (scsi_get_prot_op(task->sc) == SCSI_PROT_NORMAL) {
b76a439982f848 Israel Rukshin 2019-06-11 373 err = iser_reg_data_sg(task, mem, desc, use_dma_key, reg);
32467c420bb687 Sagi Grimberg 2015-08-06 374 if (unlikely(err))
177e31bd5a4099 Sagi Grimberg 2014-03-05 375 goto err_reg;
b76a439982f848 Israel Rukshin 2019-06-11 376 } else {
b76a439982f848 Israel Rukshin 2019-06-11 377 err = iser_reg_sig_mr(task, mem, &task->prot[dir],
b76a439982f848 Israel Rukshin 2019-06-11 378 &desc->rsc, reg);
32467c420bb687 Sagi Grimberg 2015-08-06 379 if (unlikely(err))
32467c420bb687 Sagi Grimberg 2015-08-06 380 goto err_reg;
32467c420bb687 Sagi Grimberg 2015-08-06 381
c934833e772396 zhengbin 2019-12-24 382 desc->sig_protected = true;
177e31bd5a4099 Sagi Grimberg 2014-03-05 383 }
d11ec4ecf022f4 Sagi Grimberg 2014-03-05 384
5587856c9659ac Sagi Grimberg 2013-07-28 385 return 0;
32467c420bb687 Sagi Grimberg 2015-08-06 386
5587856c9659ac Sagi Grimberg 2013-07-28 387 err_reg:
bd8b944eeeb06f Sagi Grimberg 2015-04-14 388 if (desc)
1fc431320a53f3 Israel Rukshin 2020-05-28 @389 iser_reg_desc_put_fr(ib_conn, desc);
d11ec4ecf022f4 Sagi Grimberg 2014-03-05 390
5587856c9659ac Sagi Grimberg 2013-07-28 391 return err;
5587856c9659ac Sagi Grimberg 2013-07-28 392 }
32467c420bb687 Sagi Grimberg 2015-08-06 393
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
drivers/usb/gadget/function/f_ncm.c:520 get_ncm() error: uninitialized symbol 'tmp'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Masahiro Yamada <masahiroy(a)kernel.org>
CC: "Greg Kroah-Hartman" <gregkh(a)linuxfoundation.org>
Hi Masahiro,
First bad commit (maybe != root cause):
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: f75aef392f869018f78cfedf3c320a6b3fcfda6b
commit: df8df5e4bc37e39010cfdf5d50cf726fe08aae5b usb: get rid of 'choice' for legacy gadget drivers
date: 6 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 6 months ago
config: m68k-randconfig-m031-20200831 (attached as .config)
compiler: m68k-linux-gcc (GCC) 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>
New smatch warnings:
drivers/usb/gadget/function/f_ncm.c:520 get_ncm() error: uninitialized symbol 'tmp'.
Old smatch warnings:
include/linux/skbuff.h:2852 __netdev_alloc_skb_ip_align() warn: should this be a bitwise op?
# 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 df8df5e4bc37e39010cfdf5d50cf726fe08aae5b
vim +/tmp +520 drivers/usb/gadget/function/f_ncm.c
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 503
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 504 static inline unsigned get_ncm(__le16 **p, unsigned size)
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 505 {
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 506 unsigned tmp;
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 507
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 508 switch (size) {
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 509 case 1:
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 510 tmp = get_unaligned_le16(*p);
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 511 break;
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 512 case 2:
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 513 tmp = get_unaligned_le32(*p);
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 514 break;
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 515 default:
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 516 BUG();
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 517 }
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 518
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 519 *p += size;
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 @520 return tmp;
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 521 }
9f6ce4240a2bf4 drivers/usb/gadget/f_ncm.c Yauheni Kaliuta 2010-12-08 522
:::::: The code at line 520 was first introduced by commit
:::::: 9f6ce4240a2bf456402c15c06768059e5973f28c usb: gadget: f_ncm.c added
:::::: TO: Yauheni Kaliuta <yauheni.kaliuta(a)nokia.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
[iio:testing 17/95] drivers/iio/light/as73211.c:213 as73211_integration_time_calc_avail() error: buffer overflow 'data->int_time_avail' 30 <= 58
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head: 283d2403beb406f0906cfbb2c9d7aa61cbcbbeed
commit: 77ed24daa40b3ce41610268d8307a50d82b382ad [17/95] iio: light: as73211: New driver
config: mips-randconfig-m031-20200831 (attached as .config)
compiler: mips-linux-gcc (GCC) 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>
New smatch warnings:
drivers/iio/light/as73211.c:213 as73211_integration_time_calc_avail() error: buffer overflow 'data->int_time_avail' 30 <= 58
# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=...
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio testing
git checkout 77ed24daa40b3ce41610268d8307a50d82b382ad
vim +213 drivers/iio/light/as73211.c
77ed24daa40b3c Christian Eggers 2020-08-05 206 static void as73211_integration_time_calc_avail(struct as73211_data *data)
77ed24daa40b3c Christian Eggers 2020-08-05 207 {
77ed24daa40b3c Christian Eggers 2020-08-05 208 int i;
77ed24daa40b3c Christian Eggers 2020-08-05 209
77ed24daa40b3c Christian Eggers 2020-08-05 210 for (i = 0; i < ARRAY_SIZE(data->int_time_avail); i++) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
77ed24daa40b3c Christian Eggers 2020-08-05 211 unsigned int time_us = as73211_integration_time_us(data, BIT(i));
77ed24daa40b3c Christian Eggers 2020-08-05 212
77ed24daa40b3c Christian Eggers 2020-08-05 @213 data->int_time_avail[i * 2 + 0] = time_us / USEC_PER_SEC;
^^^^^^^^^
Buffer overflow
77ed24daa40b3c Christian Eggers 2020-08-05 214 data->int_time_avail[i * 2 + 1] = time_us % USEC_PER_SEC;
^^^^^^^^^^^^^^^^^^^^^^^^
77ed24daa40b3c Christian Eggers 2020-08-05 215 }
77ed24daa40b3c Christian Eggers 2020-08-05 216 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
Re: [PATCH net-next RFC v3 03/14] devlink: Add reload actions counters to dev get
by Dan Carpenter
Hi Moshe,
[FYI, it's a private test report for your RFC patch.]
url: https://github.com/0day-ci/linux/commits/Moshe-Shemesh/Add-devlink-reload...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 0f091e43310f5c292b7094f9f115e651358e8053
config: i386-randconfig-m021-20200830 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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>
New smatch warnings:
net/core/devlink.c:507 devlink_nl_fill() error: buffer overflow 'devlink->reload_actions_cnts' 3 <= 3
Old smatch warnings:
net/core/devlink.c:5356 devlink_fmsg_prepare_skb() error: uninitialized symbol 'err'.
include/linux/u64_stats_sync.h:128 u64_stats_update_begin() warn: statement has no effect 31
# https://github.com/0day-ci/linux/commit/009b615f56e566df8c2712eb3b126c619...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Moshe-Shemesh/Add-devlink-reload-action-option/20200830-233543
git checkout 009b615f56e566df8c2712eb3b126c61959549d4
vim +507 net/core/devlink.c
bfcd3a466172094 Jiri Pirko 2016-02-26 476 static int devlink_nl_fill(struct sk_buff *msg, struct devlink *devlink,
bfcd3a466172094 Jiri Pirko 2016-02-26 477 enum devlink_command cmd, u32 portid,
bfcd3a466172094 Jiri Pirko 2016-02-26 478 u32 seq, int flags)
bfcd3a466172094 Jiri Pirko 2016-02-26 479 {
009b615f56e566d Moshe Shemesh 2020-08-30 480 struct nlattr *reload_actions_cnts, *reload_action_cnt;
bfcd3a466172094 Jiri Pirko 2016-02-26 481 void *hdr;
009b615f56e566d Moshe Shemesh 2020-08-30 482 int i;
bfcd3a466172094 Jiri Pirko 2016-02-26 483
bfcd3a466172094 Jiri Pirko 2016-02-26 484 hdr = genlmsg_put(msg, portid, seq, &devlink_nl_family, flags, cmd);
bfcd3a466172094 Jiri Pirko 2016-02-26 485 if (!hdr)
bfcd3a466172094 Jiri Pirko 2016-02-26 486 return -EMSGSIZE;
bfcd3a466172094 Jiri Pirko 2016-02-26 487
bfcd3a466172094 Jiri Pirko 2016-02-26 488 if (devlink_nl_put_handle(msg, devlink))
bfcd3a466172094 Jiri Pirko 2016-02-26 489 goto nla_put_failure;
2670ac2625f9855 Jiri Pirko 2019-09-12 490 if (nla_put_u8(msg, DEVLINK_ATTR_RELOAD_FAILED, devlink->reload_failed))
2670ac2625f9855 Jiri Pirko 2019-09-12 491 goto nla_put_failure;
bfcd3a466172094 Jiri Pirko 2016-02-26 492
009b615f56e566d Moshe Shemesh 2020-08-30 493 if (devlink_reload_supported(devlink)) {
009b615f56e566d Moshe Shemesh 2020-08-30 494 reload_actions_cnts = nla_nest_start(msg, DEVLINK_ATTR_RELOAD_ACTIONS_CNTS);
009b615f56e566d Moshe Shemesh 2020-08-30 495 if (!reload_actions_cnts)
009b615f56e566d Moshe Shemesh 2020-08-30 496 goto nla_put_failure;
009b615f56e566d Moshe Shemesh 2020-08-30 497
009b615f56e566d Moshe Shemesh 2020-08-30 498 for (i = 0; i <= DEVLINK_RELOAD_ACTION_MAX; i++) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
i is 0-3, I guess. Should this be < instead of <=?
009b615f56e566d Moshe Shemesh 2020-08-30 499 if (!devlink_reload_action_is_supported(devlink, i))
009b615f56e566d Moshe Shemesh 2020-08-30 500 continue;
009b615f56e566d Moshe Shemesh 2020-08-30 501 reload_action_cnt = nla_nest_start(msg, DEVLINK_ATTR_RELOAD_ACTION_CNT);
009b615f56e566d Moshe Shemesh 2020-08-30 502 if (!reload_action_cnt)
009b615f56e566d Moshe Shemesh 2020-08-30 503 goto reload_actions_cnts_nest_cancel;
009b615f56e566d Moshe Shemesh 2020-08-30 504 if (nla_put_u8(msg, DEVLINK_ATTR_RELOAD_ACTION, i))
009b615f56e566d Moshe Shemesh 2020-08-30 505 goto reload_action_cnt_nest_cancel;
009b615f56e566d Moshe Shemesh 2020-08-30 506 if (nla_put_u8(msg, DEVLINK_ATTR_RELOAD_ACTION_CNT_VALUE,
009b615f56e566d Moshe Shemesh 2020-08-30 @507 devlink->reload_actions_cnts[i]))
^^^
009b615f56e566d Moshe Shemesh 2020-08-30 508 goto reload_action_cnt_nest_cancel;
009b615f56e566d Moshe Shemesh 2020-08-30 509 nla_nest_end(msg, reload_action_cnt);
009b615f56e566d Moshe Shemesh 2020-08-30 510 }
009b615f56e566d Moshe Shemesh 2020-08-30 511 nla_nest_end(msg, reload_actions_cnts);
009b615f56e566d Moshe Shemesh 2020-08-30 512 }
009b615f56e566d Moshe Shemesh 2020-08-30 513
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
Re: [PATCH 14/19] floppy: use a separate gendisk for each media format
by Dan Carpenter
Hi Christoph,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.9-rc2 next-20200828]
[cannot apply to block/for-next ide/master driver-core/driver-core-testing]
[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/Christoph-Hellwig/char_dev-repla...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 1127b219ce9481c84edad9711626d856127d5e51
config: x86_64-randconfig-m001-20200830 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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>
New smatch warnings:
drivers/block/floppy.c:4592 floppy_alloc_disk() warn: passing a valid pointer to 'PTR_ERR'
# https://github.com/0day-ci/linux/commit/f08c4ae246f71af7908c08acf544e35dc...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Christoph-Hellwig/char_dev-replace-cdev_map-with-an-xarray/20200830-152505
git checkout f08c4ae246f71af7908c08acf544e35dcc4b672b
vim +/PTR_ERR +4592 drivers/block/floppy.c
f08c4ae246f71af Christoph Hellwig 2020-08-30 4581 static int floppy_alloc_disk(unsigned int drive, unsigned int type)
^1da177e4c3f415 Linus Torvalds 2005-04-16 4582 {
f08c4ae246f71af Christoph Hellwig 2020-08-30 4583 struct gendisk *disk;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4584 int err;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4585
f08c4ae246f71af Christoph Hellwig 2020-08-30 4586 disk = alloc_disk(1);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4587 if (!disk)
f08c4ae246f71af Christoph Hellwig 2020-08-30 4588 return -ENOMEM;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4589
f08c4ae246f71af Christoph Hellwig 2020-08-30 4590 disk->queue = blk_mq_init_queue(&tag_sets[drive]);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4591 if (IS_ERR(disk->queue)) {
f08c4ae246f71af Christoph Hellwig 2020-08-30 @4592 err = PTR_ERR(disk);
^^^^^^^^^^^^^
err = PTR_ERR(disk->queue);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4593 disk->queue = NULL;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4594 put_disk(disk);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4595 return err;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4596 }
f08c4ae246f71af Christoph Hellwig 2020-08-30 4597
f08c4ae246f71af Christoph Hellwig 2020-08-30 4598 blk_queue_bounce_limit(disk->queue, BLK_BOUNCE_HIGH);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4599 blk_queue_max_hw_sectors(disk->queue, 64);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4600 disk->major = FLOPPY_MAJOR;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4601 disk->first_minor = TOMINOR(drive) | (type << 2);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4602 disk->fops = &floppy_fops;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4603 disk->events = DISK_EVENT_MEDIA_CHANGE;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4604 if (type)
f08c4ae246f71af Christoph Hellwig 2020-08-30 4605 sprintf(disk->disk_name, "fd%d_type%d", drive, type);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4606 else
f08c4ae246f71af Christoph Hellwig 2020-08-30 4607 sprintf(disk->disk_name, "fd%d", drive);
f08c4ae246f71af Christoph Hellwig 2020-08-30 4608 /* to be cleaned up... */
f08c4ae246f71af Christoph Hellwig 2020-08-30 4609 disk->private_data = (void *)(long)drive;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4610 disk->flags |= GENHD_FL_REMOVABLE;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4611
f08c4ae246f71af Christoph Hellwig 2020-08-30 4612 disks[drive][type] = disk;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4613 return 0;
f08c4ae246f71af Christoph Hellwig 2020-08-30 4614 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
[iio:testing 75/76] drivers/iio/accel/adxl372.c:350 adxl372_write_threshold_value() warn: inconsistent returns 'st->threshold_m'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git testing
head: b7959420e446032114da12b9af2a36ab62396dce
commit: 84847a0a0c6314106e93d75ee9f50401fd0806ec [75/76] iio: accel: adxl372: Add support for FIFO peak mode
config: microblaze-randconfig-m031-20200830 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 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:
drivers/iio/accel/adxl372.c:350 adxl372_write_threshold_value() warn: inconsistent returns 'st->threshold_m'.
# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=...
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio testing
git checkout 84847a0a0c6314106e93d75ee9f50401fd0806ec
vim +350 drivers/iio/accel/adxl372.c
84847a0a0c6314 Stefan Popa 2020-08-10 334 static ssize_t adxl372_write_threshold_value(struct iio_dev *indio_dev, unsigned int addr,
84847a0a0c6314 Stefan Popa 2020-08-10 335 u16 threshold)
84847a0a0c6314 Stefan Popa 2020-08-10 336 {
84847a0a0c6314 Stefan Popa 2020-08-10 337 struct adxl372_state *st = iio_priv(indio_dev);
84847a0a0c6314 Stefan Popa 2020-08-10 338 int ret;
84847a0a0c6314 Stefan Popa 2020-08-10 339
84847a0a0c6314 Stefan Popa 2020-08-10 340 mutex_lock(&st->threshold_m);
84847a0a0c6314 Stefan Popa 2020-08-10 341 ret = regmap_write(st->regmap, addr, ADXL372_THRESH_VAL_H_SEL(threshold));
84847a0a0c6314 Stefan Popa 2020-08-10 342 if (ret < 0)
84847a0a0c6314 Stefan Popa 2020-08-10 343 return ret;
^^^^^^^^^^
Goto unlock before returning
84847a0a0c6314 Stefan Popa 2020-08-10 344
84847a0a0c6314 Stefan Popa 2020-08-10 345 ret = regmap_update_bits(st->regmap, addr + 1, GENMASK(7, 5),
84847a0a0c6314 Stefan Popa 2020-08-10 346 ADXL372_THRESH_VAL_L_SEL(threshold) << 5);
84847a0a0c6314 Stefan Popa 2020-08-10 347
84847a0a0c6314 Stefan Popa 2020-08-10 348 mutex_unlock(&st->threshold_m);
84847a0a0c6314 Stefan Popa 2020-08-10 349
84847a0a0c6314 Stefan Popa 2020-08-10 @350 return ret;
84847a0a0c6314 Stefan Popa 2020-08-10 351 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
[iio:fixes-togreg 19/19] drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git fixes-togreg
head: ba255800f7fbb8da411c92c33b25d52970558509
commit: ba255800f7fbb8da411c92c33b25d52970558509 [19/19] iio: adc: mcp3422: fix locking scope
config: x86_64-randconfig-m001-20200830 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 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:
drivers/iio/adc/mcp3422.c:155 mcp3422_read_channel() warn: inconsistent returns 'adc->lock'.
# https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git/commit/?id=...
git remote add iio https://git.kernel.org/pub/scm/linux/kernel/git/jic23/iio.git
git fetch --no-tags iio fixes-togreg
git checkout ba255800f7fbb8da411c92c33b25d52970558509
vim +155 drivers/iio/adc/mcp3422.c
07914c84ba30e3 Angelo Compagnucci 2013-09-02 130 static int mcp3422_read_channel(struct mcp3422 *adc,
07914c84ba30e3 Angelo Compagnucci 2013-09-02 131 struct iio_chan_spec const *channel, int *value)
07914c84ba30e3 Angelo Compagnucci 2013-09-02 132 {
07914c84ba30e3 Angelo Compagnucci 2013-09-02 133 int ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 134 u8 config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 135 u8 req_channel = channel->channel;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 136
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 137 mutex_lock(&adc->lock);
^^^^^^^^^^^^^^^^^^^^^^
Lock
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 138
07914c84ba30e3 Angelo Compagnucci 2013-09-02 139 if (req_channel != MCP3422_CHANNEL(adc->config)) {
07914c84ba30e3 Angelo Compagnucci 2013-09-02 140 config = adc->config;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 141 config &= ~MCP3422_CHANNEL_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 142 config |= MCP3422_CHANNEL_VALUE(req_channel);
07914c84ba30e3 Angelo Compagnucci 2013-09-02 143 config &= ~MCP3422_PGA_MASK;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 144 config |= MCP3422_PGA_VALUE(adc->pga[req_channel]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02 145 ret = mcp3422_update_config(adc, config);
07914c84ba30e3 Angelo Compagnucci 2013-09-02 146 if (ret < 0)
07914c84ba30e3 Angelo Compagnucci 2013-09-02 147 return ret;
^^^^^^^^^^
goto unlock
07914c84ba30e3 Angelo Compagnucci 2013-09-02 148 msleep(mcp3422_read_times[MCP3422_SAMPLE_RATE(adc->config)]);
07914c84ba30e3 Angelo Compagnucci 2013-09-02 149 }
07914c84ba30e3 Angelo Compagnucci 2013-09-02 150
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 151 ret = mcp3422_read(adc, value, &config);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 152
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 153 mutex_unlock(&adc->lock);
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 154
ba255800f7fbb8 Angelo Compagnucci 2020-08-19 @155 return ret;
07914c84ba30e3 Angelo Compagnucci 2013-09-02 156 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce net: dsa: sja1105: add a new best_effort_vlan_filtering devlink parameter
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 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>
New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.
# 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 2cafa72e516f61b6d82c2416b4f5963fb48fd9ce
vim +/rc +2342 drivers/net/dsa/sja1105/sja1105_main.c
2cafa72e516f61 Vladimir Oltean 2020-05-12 2316 static int sja1105_best_effort_vlan_filtering_set(struct sja1105_private *priv,
2cafa72e516f61 Vladimir Oltean 2020-05-12 2317 bool be_vlan)
2cafa72e516f61 Vladimir Oltean 2020-05-12 2318 {
2cafa72e516f61 Vladimir Oltean 2020-05-12 2319 struct dsa_switch *ds = priv->ds;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2320 bool vlan_filtering;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2321 int port;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2322 int rc;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2323
2cafa72e516f61 Vladimir Oltean 2020-05-12 2324 priv->best_effort_vlan_filtering = be_vlan;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2325
2cafa72e516f61 Vladimir Oltean 2020-05-12 2326 rtnl_lock();
2cafa72e516f61 Vladimir Oltean 2020-05-12 2327 for (port = 0; port < ds->num_ports; port++) {
2cafa72e516f61 Vladimir Oltean 2020-05-12 2328 struct dsa_port *dp;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2329
2cafa72e516f61 Vladimir Oltean 2020-05-12 2330 if (!dsa_is_user_port(ds, port))
2cafa72e516f61 Vladimir Oltean 2020-05-12 2331 continue;
What if ds->num_ports is zero or they're all user ports?
2cafa72e516f61 Vladimir Oltean 2020-05-12 2332
2cafa72e516f61 Vladimir Oltean 2020-05-12 2333 dp = dsa_to_port(ds, port);
2cafa72e516f61 Vladimir Oltean 2020-05-12 2334 vlan_filtering = dsa_port_is_vlan_filtering(dp);
2cafa72e516f61 Vladimir Oltean 2020-05-12 2335
2cafa72e516f61 Vladimir Oltean 2020-05-12 2336 rc = sja1105_vlan_filtering(ds, port, vlan_filtering);
2cafa72e516f61 Vladimir Oltean 2020-05-12 2337 if (rc)
2cafa72e516f61 Vladimir Oltean 2020-05-12 2338 break;
2cafa72e516f61 Vladimir Oltean 2020-05-12 2339 }
2cafa72e516f61 Vladimir Oltean 2020-05-12 2340 rtnl_unlock();
2cafa72e516f61 Vladimir Oltean 2020-05-12 2341
2cafa72e516f61 Vladimir Oltean 2020-05-12 @2342 return rc;
^^^^^^^^^
2cafa72e516f61 Vladimir Oltean 2020-05-12 2343 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months
drivers/net/dsa/sja1105/sja1105_main.c:1608 sja1105_static_config_reload() warn: bitwise AND condition is false here
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 4d41ead6ead97c3730bbd186a601a64828668f01
commit: ffe10e679cec9a99f19049459cb27c2fbb1e913a net: dsa: sja1105: Add support for the SGMII port
config: arm-randconfig-m031-20200829 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 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>
New smatch warnings:
drivers/net/dsa/sja1105/sja1105_main.c:1608 sja1105_static_config_reload() warn: bitwise AND condition is false here
# 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 ffe10e679cec9a99f19049459cb27c2fbb1e913a
vim +1608 drivers/net/dsa/sja1105/sja1105_main.c
6666cebc5e306f Vladimir Oltean 2019-05-02 1590 for (i = 0; i < SJA1105_NUM_PORTS; i++) {
8400cff60b472c Vladimir Oltean 2019-06-08 1591 rc = sja1105_adjust_port_config(priv, i, speed_mbps[i]);
6666cebc5e306f Vladimir Oltean 2019-05-02 1592 if (rc < 0)
6666cebc5e306f Vladimir Oltean 2019-05-02 1593 goto out;
6666cebc5e306f Vladimir Oltean 2019-05-02 1594 }
ffe10e679cec9a Vladimir Oltean 2020-03-20 1595
ffe10e679cec9a Vladimir Oltean 2020-03-20 1596 if (sja1105_supports_sgmii(priv, SJA1105_SGMII_PORT)) {
ffe10e679cec9a Vladimir Oltean 2020-03-20 1597 bool an_enabled = !!(bmcr & BMCR_ANENABLE);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1598
ffe10e679cec9a Vladimir Oltean 2020-03-20 1599 sja1105_sgmii_pcs_config(priv, an_enabled, false);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1600
ffe10e679cec9a Vladimir Oltean 2020-03-20 1601 if (!an_enabled) {
ffe10e679cec9a Vladimir Oltean 2020-03-20 1602 int speed = SPEED_UNKNOWN;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1603
ffe10e679cec9a Vladimir Oltean 2020-03-20 1604 if (bmcr & BMCR_SPEED1000)
ffe10e679cec9a Vladimir Oltean 2020-03-20 1605 speed = SPEED_1000;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1606 else if (bmcr & BMCR_SPEED100)
ffe10e679cec9a Vladimir Oltean 2020-03-20 1607 speed = SPEED_100;
ffe10e679cec9a Vladimir Oltean 2020-03-20 @1608 else if (bmcr & BMCR_SPEED10)
^^^^^^^^^^^^^^^^^^^
This is an impossible condition. BMCR_SPEED10 is zero.
ffe10e679cec9a Vladimir Oltean 2020-03-20 1609 speed = SPEED_10;
ffe10e679cec9a Vladimir Oltean 2020-03-20 1610
ffe10e679cec9a Vladimir Oltean 2020-03-20 1611 sja1105_sgmii_pcs_force_speed(priv, speed);
ffe10e679cec9a Vladimir Oltean 2020-03-20 1612 }
ffe10e679cec9a Vladimir Oltean 2020-03-20 1613 }
6666cebc5e306f Vladimir Oltean 2019-05-02 1614 out:
af580ae2dcb250 Vladimir Oltean 2019-11-09 1615 mutex_unlock(&priv->mgmt_lock);
af580ae2dcb250 Vladimir Oltean 2019-11-09 1616
6666cebc5e306f Vladimir Oltean 2019-05-02 1617 return rc;
6666cebc5e306f Vladimir Oltean 2019-05-02 1618 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
6 months