Skip to contentSkip to conversation

mfd: core: fix device reference leak in mfd_clone_cell

PATCH Applied Johan Hovold 2 participants 6 messages Nov 1, 2016 – Nov 16, 2016 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: core: fix device reference leak in mfd_clone_cell

Make sure to drop the reference taken by bus_find_device_by_name() before returning from mfd_clone_cell().

Fixes a9bbba996302 ("mfd: add platform_device sharing support for mfd")
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/mfd/mfd-core.c +2 -0
index 3ac486a597f3..c57e407020f1 100644
@@ -399,6 +399,8 @@ int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones)
 					clones[i]);
 	}
 
+	put_device(dev);
+
 	return 0;
 }
 EXPORT_SYMBOL(mfd_clone_cell);
Signature · 1 line
2.7.3
Applied
#1 lore raw
Quoted 8 lines · Johan Hovold

Make sure to drop the reference taken by bus_find_device_by_name() before returning from mfd_clone_cell().

Fixes a9bbba996302 ("mfd: add platform_device sharing support for mfd")
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Quoted 13 lines
drivers/mfd/mfd-core.c +2 -0
index 3ac486a597f3..c57e407020f1 100644
@@ -399,6 +399,8 @@ int mfd_clone_cell(const char *cell, const char **clones, size_t n_clones)
 					clones[i]);
 	}
 
+	put_device(dev);
+
 	return 0;
 }
 EXPORT_SYMBOL(mfd_clone_cell);
Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw
Quoted 5 lines · Lee Jones
Quoted 3 lines · Johan Hovold

Make sure to drop the reference taken by bus_find_device_by_name() before returning from mfd_clone_cell().

Quoted 7 lines
Quoted 5 lines
Fixes a9bbba996302 ("mfd: add platform_device sharing support for mfd")
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

I do not see this one in linux-next (or your tree). Did you forget to push?

Thanks,
Johan

#3 lore raw
Quoted 12 lines · Johan Hovold
Quoted 11 lines · Lee Jones
Quoted 8 lines · Johan Hovold

Make sure to drop the reference taken by bus_find_device_by_name() before returning from mfd_clone_cell().

Fixes a9bbba996302 ("mfd: add platform_device sharing support for mfd")
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 4 lines
Quoted 1 line

Applied, thanks.

I do not see this one in linux-next (or your tree). Did you forget to push?

Since I tend to flit between maintaining and real-work, I tend to bulk push once I have a bunch of fixes/updates. Your fix should appear in -next tomorrow. The plan is to have it in upstream by next week.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#4 lore raw
Quoted 14 lines · Lee Jones
Quoted 12 lines · Johan Hovold
Quoted 11 lines · Lee Jones
Quoted 8 lines · Johan Hovold

Make sure to drop the reference taken by bus_find_device_by_name() before returning from mfd_clone_cell().

Fixes a9bbba996302 ("mfd: add platform_device sharing support for mfd")
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)
Quoted 8 lines
Quoted 4 lines
Quoted 1 line

Applied, thanks.

I do not see this one in linux-next (or your tree). Did you forget to push?

Since I tend to flit between maintaining and real-work, I tend to bulk push once I have a bunch of fixes/updates. Your fix should appear in -next tomorrow. The plan is to have it in upstream by next week.

Sounds good, thanks for the explanation.

Johan

#5 lore raw
Quoted 17 lines · Johan Hovold
Quoted 16 lines · Lee Jones
Quoted 14 lines · Johan Hovold
Quoted 12 lines · Lee Jones
Quoted 8 lines · Johan Hovold

Make sure to drop the reference taken by bus_find_device_by_name() before returning from mfd_clone_cell().

Fixes a9bbba996302 ("mfd: add platform_device sharing support for mfd")
---
 drivers/mfd/mfd-core.c | 2 ++
 1 file changed, 2 insertions(+)

Applied, thanks.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

I do not see this one in linux-next (or your tree). Did you forget to push?

Since I tend to flit between maintaining and real-work, I tend to bulk push once I have a bunch of fixes/updates. Your fix should appear in -next tomorrow. The plan is to have it in upstream by next week.

Sounds good, thanks for the explanation.

FYI, I submitted your patch to Linus today.

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog