Unverified Commit bab62f5b authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'reset-fixes-for-v6.17' of https://git.pengutronix.de/git/pza/linux into arm/fixes

Reset controller fixes for v6.17

* Fix an OF node reference leak in the EyeQ reset controller driver.

* tag 'reset-fixes-for-v6.17' of https://git.pengutronix.de/git/pza/linux:
  reset: eyeq: fix OF node leak

Link: https://lore.kernel.org/r/20250904153345.2374313-1-p.zabel@pengutronix.de


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents f1a43af7 9a52827a
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -410,6 +410,13 @@ static int eqr_of_xlate_twocells(struct reset_controller_dev *rcdev,
	return eqr_of_xlate_internal(rcdev, reset_spec->args[0], reset_spec->args[1]);
}

static void eqr_of_node_put(void *_dev)
{
	struct device *dev = _dev;

	of_node_put(dev->of_node);
}

static int eqr_probe(struct auxiliary_device *adev,
		     const struct auxiliary_device_id *id)
{
@@ -428,6 +435,10 @@ static int eqr_probe(struct auxiliary_device *adev,
	if (!dev->of_node)
		return -ENODEV;

	ret = devm_add_action_or_reset(dev, eqr_of_node_put, dev);
	if (ret)
		return ret;

	/*
	 * Using our newfound OF node, we can get match data. We cannot use
	 * device_get_match_data() because it does not match reused OF nodes.