summaryrefslogtreecommitdiff
path: root/drivers/reset/core.c
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2021-06-17 12:54:28 -0700
committerOlof Johansson <olof@lixom.net>2021-06-17 12:57:14 -0700
commit25da503ecce8f523c1c1c678659cb484d3bcd73f (patch)
tree00aedb891a1c0d01a1fb9e1c462ad83b33273a1f /drivers/reset/core.c
parent1eb5f83ee936de6a69b2bcee95088a6e0ab7c202 (diff)
parent48a74b1147f7db4623eaed591cc01eb740b871c0 (diff)
Merge tag 'reset-for-v5.14-2' of git://git.pengutronix.de/pza/linux into arm/drivers
Reset controller updates for v5.14, part2 This tag contains a few small fixes, allows to build the Berlin reset driver as a module, and adds stubs to the reset controller API to allow compile-testing drivers outside of drivers/reset without enabling the reset framework. * tag 'reset-for-v5.14-2' of git://git.pengutronix.de/pza/linux: reset: Add compile-test stubs reset: berlin: support module build reset: bail if try_module_get() fails reset: mchp: sparx5: fix return value check in mchp_sparx5_map_io() reset: lantiq: use devm_reset_controller_register() reset: hi6220: Use the correct HiSilicon copyright Link: https://lore.kernel.org/r/14d33ac19b2a107e97ce1ab264987b707baa9ba7.camel@pengutronix.de Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/reset/core.c')
-rw-r--r--drivers/reset/core.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/reset/core.c b/drivers/reset/core.c
index 63852076a5a3..61e688882643 100644
--- a/drivers/reset/core.c
+++ b/drivers/reset/core.c
@@ -774,7 +774,10 @@ __reset_control_get_internal(struct reset_controller_dev *rcdev,
if (!rstc)
return ERR_PTR(-ENOMEM);
- try_module_get(rcdev->owner);
+ if (!try_module_get(rcdev->owner)) {
+ kfree(rstc);
+ return ERR_PTR(-ENODEV);
+ }
rstc->rcdev = rcdev;
list_add(&rstc->list, &rcdev->reset_control_head);