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

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

Reset controller fixes for v6.7

Fix a void-pointer-to-enum-cast warning in the hisilicon hi6220 reset
driver and fix a NULL pointer dereference when freeing non-existent
optional resets requested via the reset_array API in the core.

* tag 'reset-fixes-for-v6.7' of git://git.pengutronix.de/pza/linux:
  reset: Fix crash when freeing non-existent optional resets
  reset: hisilicon: hi6220: fix Wvoid-pointer-to-enum-cast warning

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


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 81556f22 4a6756f5
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -807,6 +807,9 @@ static void __reset_control_put_internal(struct reset_control *rstc)
{
	lockdep_assert_held(&reset_list_mutex);

	if (IS_ERR_OR_NULL(rstc))
		return;

	kref_put(&rstc->refcnt, __reset_control_release);
}

@@ -1017,11 +1020,8 @@ EXPORT_SYMBOL_GPL(reset_control_put);
void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs)
{
	mutex_lock(&reset_list_mutex);
	while (num_rstcs--) {
		if (IS_ERR_OR_NULL(rstcs[num_rstcs].rstc))
			continue;
	while (num_rstcs--)
		__reset_control_put_internal(rstcs[num_rstcs].rstc);
	}
	mutex_unlock(&reset_list_mutex);
}
EXPORT_SYMBOL_GPL(reset_control_bulk_put);
+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ static int hi6220_reset_probe(struct platform_device *pdev)
	if (!data)
		return -ENOMEM;

	type = (enum hi6220_reset_ctrl_type)of_device_get_match_data(dev);
	type = (uintptr_t)of_device_get_match_data(dev);

	regmap = syscon_node_to_regmap(np);
	if (IS_ERR(regmap)) {