Re: [PATCH] serial: 8250_bcm7271: Fix error handling in brcmuart_init()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/8/22 23:21, 'Yuan Can' via BCM-KERNEL-FEEDBACK-LIST,PDL wrote:
A problem about 8250_bcm7271 create debugfs failed is triggered with the
following log given:

  [  324.516635] debugfs: Directory 'bcm7271-uart' with parent '/' already present!

The reason is that brcmuart_init() returns platform_driver_register()
directly without checking its return value, if platform_driver_register()
failed, it returns without destroy the newly created debugfs, resulting
the debugfs of 8250_bcm7271 can never be created later.

  brcmuart_init()
    debugfs_create_dir() # create debugfs directory
    platform_driver_register()
      driver_register()
        bus_add_driver()
          priv = kzalloc(...) # OOM happened
    # return without destroy debugfs directory

Fix by removing debugfs when platform_driver_register() returns error.

Fixes: 41a469482de2 ("serial: 8250: Add new 8250-core based Broadcom STB driver")
Signed-off-by: Yuan Can <yuancan@xxxxxxxxxx>

Acked-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
--
Florian




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux