1. 24 Nov, 2022 2 commits
    • Zheng Yongjun's avatar
      mtd: maps: pxa2xx-flash: fix memory leak in probe · 2399401f
      Zheng Yongjun authored
      Free 'info' upon remapping error to avoid a memory leak.
      
      Fixes: e644f7d6 ("[MTD] MAPS: Merge Lubbock and Mainstone drivers into common PXA2xx driver")
      Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
      [<miquel.raynal@bootlin.com>: Reword the commit log]
      Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Link: https://lore.kernel.org/linux-mtd/20221119073307.22929-1-zhengyongjun3@huawei.com
      2399401f
    • Shang XiaoJing's avatar
      mtd: core: Fix refcount error in del_mtd_device() · 56570bda
      Shang XiaoJing authored
      del_mtd_device() will call of_node_put() to mtd_get_of_node(mtd), which
      is mtd->dev.of_node. However, memset(&mtd->dev, 0) is called before
      of_node_put(). As the result, of_node_put() won't do anything in
      del_mtd_device(), and causes the refcount leak.
      
      del_mtd_device()
          memset(&mtd->dev, 0, sizeof(mtd->dev) # clear mtd->dev
          of_node_put()
              mtd_get_of_node(mtd) # mtd->dev is cleared, can't locate of_node
                                   # of_node_put(NULL) won't do anything
      
      Fix the error by caching the pointer of the device_node.
      
      OF: ERROR: memory leak, expected refcount 1 instead of 2,
      of_node_get()/of_node_put() unbalanced - destroy cset entry: attach
      overlay node /spi/spi-sram@0
      CPU: 3 PID: 275 Comm: python3 Tainted: G N 6.1.0-rc3+ #54
          0d8a1edddf51f172ff5226989a7565c6313b08e2
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS
      rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org 04/01/2014
      Call Trace:
      <TASK>
          dump_stack_lvl+0x67/0x83
          kobject_get+0x155/0x160
          of_node_get+0x1f/0x30
          of_fwnode_get+0x43/0x70
          fwnode_handle_get+0x54/0x80
          fwnode_get_nth_parent+0xc9/0xe0
          fwnode_full_name_string+0x3f/0xa0
          device_node_string+0x30f/0x750
          pointer+0x598/0x7a0
          vsnprintf+0x62d/0x9b0
          ...
          cfs_overlay_release+0x30/0x90
          config_item_release+0xbe/0x1a0
          config_item_put+0x5e/0x80
          configfs_rmdir+0x3bd/0x540
          vfs_rmdir+0x18c/0x320
          do_rmdir+0x198/0x330
          __x64_sys_rmdir+0x2c/0x40
          do_syscall_64+0x37/0x90
          entry_SYSCALL_64_after_hwframe+0x63/0xcd
      
      Fixes: 00596576 ("mtd: core: clear out unregistered devices a bit more")
      Signed-off-by: default avatarShang XiaoJing <shangxiaojing@huawei.com>
      [<miquel.raynal@bootlin.com>: Light reword of the commit log]
      Signed-off-by: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
      Link: https://lore.kernel.org/linux-mtd/20221119063915.11108-1-shangxiaojing@huawei.com
      56570bda
  2. 17 Nov, 2022 21 commits
  3. 07 Nov, 2022 14 commits
  4. 30 Oct, 2022 3 commits
    • Linus Torvalds's avatar
      Linux 6.1-rc3 · 30a0b95b
      Linus Torvalds authored
      30a0b95b
    • Linus Torvalds's avatar
      Merge tag 'fbdev-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev · b72018ab
      Linus Torvalds authored
      Pull fbdev fixes from Helge Deller:
       "A use-after-free bugfix in the smscufx driver and various minor error
        path fixes, smaller build fixes, sysfs fixes and typos in comments in
        the stifb, sisfb, da8xxfb, xilinxfb, sm501fb, gbefb and cyber2000fb
        drivers"
      
      * tag 'fbdev-for-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/linux-fbdev:
        fbdev: cyber2000fb: fix missing pci_disable_device()
        fbdev: sisfb: use explicitly signed char
        fbdev: smscufx: Fix several use-after-free bugs
        fbdev: xilinxfb: Make xilinxfb_release() return void
        fbdev: sisfb: fix repeated word in comment
        fbdev: gbefb: Convert sysfs snprintf to sysfs_emit
        fbdev: sm501fb: Convert sysfs snprintf to sysfs_emit
        fbdev: stifb: Fall back to cfb_fillrect() on 32-bit HCRX cards
        fbdev: da8xx-fb: Fix error handling in .remove()
        fbdev: MIPS supports iomem addresses
      b72018ab
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 9f127546
      Linus Torvalds authored
      Pull char/misc fixes from Greg KH:
       "Some small driver fixes for 6.1-rc3.  They include:
      
         - iio driver bugfixes
      
         - counter driver bugfixes
      
         - coresight bugfixes, including a revert and then a second fix to get
           it right.
      
        All of these have been in linux-next with no reported problems"
      
      * tag 'char-misc-6.1-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (21 commits)
        misc: sgi-gru: use explicitly signed char
        coresight: cti: Fix hang in cti_disable_hw()
        Revert "coresight: cti: Fix hang in cti_disable_hw()"
        counter: 104-quad-8: Fix race getting function mode and direction
        counter: microchip-tcb-capture: Handle Signal1 read and Synapse
        coresight: cti: Fix hang in cti_disable_hw()
        coresight: Fix possible deadlock with lock dependency
        counter: ti-ecap-capture: fix IS_ERR() vs NULL check
        counter: Reduce DEFINE_COUNTER_ARRAY_POLARITY() to defining counter_array
        iio: bmc150-accel-core: Fix unsafe buffer attributes
        iio: adxl367: Fix unsafe buffer attributes
        iio: adxl372: Fix unsafe buffer attributes
        iio: at91-sama5d2_adc: Fix unsafe buffer attributes
        iio: temperature: ltc2983: allocate iio channels once
        tools: iio: iio_utils: fix digit calculation
        iio: adc: stm32-adc: fix channel sampling time init
        iio: adc: mcp3911: mask out device ID in debug prints
        iio: adc: mcp3911: use correct id bits
        iio: adc: mcp3911: return proper error code on failure to allocate trigger
        iio: adc: mcp3911: fix sizeof() vs ARRAY_SIZE() bug
        ...
      9f127546