Skip to content

Commit 4d1b508

Browse files
jhovoldgregkh
authored andcommitted
bus: vexpress-config: fix device reference leak
commit c090959b9dd8c87703e275079aa4b4a824ba3f8e upstream. Make sure to drop the reference to the parent device taken by class_find_device() after populating the bus. Fixes: 3b9334a ("mfd: vexpress: Convert custom func API to regmap") Acked-by: Sudeep Holla <sudeep.holla@arm.com> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 6e8210a commit 4d1b508

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

drivers/bus/vexpress-config.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ static int vexpress_config_populate(struct device_node *node)
171171
{
172172
struct device_node *bridge;
173173
struct device *parent;
174+
int ret;
174175

175176
bridge = of_parse_phandle(node, "arm,vexpress,config-bridge", 0);
176177
if (!bridge)
@@ -181,7 +182,11 @@ static int vexpress_config_populate(struct device_node *node)
181182
if (WARN_ON(!parent))
182183
return -ENODEV;
183184

184-
return of_platform_populate(node, NULL, NULL, parent);
185+
ret = of_platform_populate(node, NULL, NULL, parent);
186+
187+
put_device(parent);
188+
189+
return ret;
185190
}
186191

187192
static int __init vexpress_config_init(void)

0 commit comments

Comments
 (0)