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. -----BEGIN PGP SIGNATURE----- iI0EABYIADUWIQRRO6F6WdpH1R0vGibVhaclGDdiwAUCZXnM1hcccC56YWJlbEBw ZW5ndXRyb25peC5kZQAKCRDVhaclGDdiwKbYAQCUnnAIxLpSwo99SITk3DThE7zE S4zETh4qOQsGTHsZcwD/WyatdJ5DKD2RxO9QEh9fKDajlb+cicIvg2yKBSZKrwg= =ZhjB -----END PGP SIGNATURE----- gpgsig -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmV7bV4ACgkQYKtH/8kJ UifCKBAAmVz/PCZHwCuDqFdW26H3k4hRafFnqLmwWRIu7tvftb+Hbddnw74i+Nal UQtLOBzABYCjkNM2KXGSx0aOApaLlvcptUDFQIEdb/LkxG6tSjcwywm1CN/sCHUx HG59aCGxMAmu6FJ7JkfajJPldG1pdOBYf72GkROfyiUxmWmS+PPI9ZocTmUGOBgi nt7GM9Ll70I0icirNW00fNd0YvclClfSl6BWnbB4FIdTmquGBfjXPkEXjI5p8Bxx kKvYIbUaANxf6PyBU4MD0XQr4hLZ4Huqx/AVF4swNZeB67OR/WNtsE62vgfuvGhR eUiDiX9JdVjqZmjrstj352ak3HdeMJnwXnNCtjie/C4ObyL8E+ooKCM8oJLaOtE3 P6s9ThBEYaKaveOTWIyUYhUyz8h64PVetP0cpsAbHX8tibTTZgFHQlh6XkFaW5b/ sAvq8EbLkwPSN5XJoVnTUSfMEBbWvnzOD8Z1cCIPXw94LAlBpoBKJlNZjN1Syd96 2N93mZSyqAi/s4XM63gjRe0O9+Tduta7COKQSQ6MPtTMawqNsGILIfys+F9GfGi6 1UztmQzQm9d3rmenLMA73tpteB26CQllaK0He2zZxNCK2sRDFYPRQsUmrGmTWS+A 2Nlh4Y6aZJXVZXBO87G7f5x26tmnbXV/ZcSuAqm7lR/ambZTPEo= =liYV -----END PGP SIGNATURE----- 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: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
commit
d73ad797c8
@ -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);
|
||||
|
@ -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)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user