]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create()
authorLin Yujun <linyujun809@huawei.com>
Wed, 14 Sep 2022 03:28:07 +0000 (11:28 +0800)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Mon, 19 Sep 2022 14:32:54 +0000 (16:32 +0200)
commita938512dd4fa1faf30dc5f5cb0c1822c486504d3
tree6feefbe28b3f2bb94c9898614bf6a53b2641a09e
parent3c8f4a6aa961c8f2e43da1432e940bbba46b399c
MIPS: SGI-IP30: Fix platform-device leak in bridge_platform_create()

In error case in bridge_platform_create after calling
platform_device_add()/platform_device_add_data()/
platform_device_add_resources(), release the failed
'pdev' or it will be leak, call platform_device_put()
to fix this problem.

Besides, 'pdev' is divided into 'pdev_wd' and 'pdev_bd',
use platform_device_unregister() to release sgi_w1
resources when xtalk-bridge registration fails.

Fixes: d7e70e894df8 ("MIPS: add support for SGI Octane (IP30)")
Signed-off-by: Lin Yujun <linyujun809@huawei.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/sgi-ip30/ip30-xtalk.c