Skip to content

Commit d73ad79

Browse files
committed
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/[email protected] Signed-off-by: Arnd Bergmann <[email protected]>
2 parents 81556f2 + 4a6756f commit d73ad79

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

drivers/reset/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,9 @@ static void __reset_control_put_internal(struct reset_control *rstc)
807807
{
808808
lockdep_assert_held(&reset_list_mutex);
809809

810+
if (IS_ERR_OR_NULL(rstc))
811+
return;
812+
810813
kref_put(&rstc->refcnt, __reset_control_release);
811814
}
812815

@@ -1017,11 +1020,8 @@ EXPORT_SYMBOL_GPL(reset_control_put);
10171020
void reset_control_bulk_put(int num_rstcs, struct reset_control_bulk_data *rstcs)
10181021
{
10191022
mutex_lock(&reset_list_mutex);
1020-
while (num_rstcs--) {
1021-
if (IS_ERR_OR_NULL(rstcs[num_rstcs].rstc))
1022-
continue;
1023+
while (num_rstcs--)
10231024
__reset_control_put_internal(rstcs[num_rstcs].rstc);
1024-
}
10251025
mutex_unlock(&reset_list_mutex);
10261026
}
10271027
EXPORT_SYMBOL_GPL(reset_control_bulk_put);

drivers/reset/hisilicon/hi6220_reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static int hi6220_reset_probe(struct platform_device *pdev)
163163
if (!data)
164164
return -ENOMEM;
165165

166-
type = (enum hi6220_reset_ctrl_type)of_device_get_match_data(dev);
166+
type = (uintptr_t)of_device_get_match_data(dev);
167167

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

0 commit comments

Comments
 (0)