Skip to content

Convert manual kfree(dev) to put_device()

Tarun Sahu linux-arm-kernel linuxppc-dev lkml 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest3 patches 1 replyIn review
  2. v33 patches 2 repliesSuperseded
  3. v23 patches 3 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches3 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ARM: locomo: Fix device reference leak on registration failurearch/arm/common/locomo.c+6 -70 replies
2/3firmware: edd: Fix kobject reference leak on registration failuredrivers/firmware/edd.c+1 -10 replies
3/3powerpc/ps3: use put_device() on device_register() failure in ps3_system_bus_device_registerarch/powerpc/platforms/ps3/device-init.c arch/powerpc/platforms/ps3/system-bus.c+52 -330 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchSourabh Jain
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/3] Convert manual kfree(dev) to put_device()

Hello,

As per the kernel-doc guidelines, Devices that are tried to register with device_register or to add using device_add, must use put_device on their failure path (not kfree). This series contains 3 patches for updating such instances. Same for kobject_init_and_add or kobject_add, call kobject_put instead of kfree in case of error.

V4 <- V3
1. Added Fixes tags
2. update commit msg as per the suggestion on v3

V3 <- V2
1. Updated the commit msg of each patch to mention about the kernel-doc guidelines.

V2 <- V1
1. Removed patch [1] as it is part of another series [2] already.

[1]: https://lore.kernel.org/all/[email protected]/
[2]: https://lore.kernel.org/all/[email protected]/

Tarun Sahu (3):
ARM: locomo: Fix device reference leak on registration failure
firmware: edd: Fix kobject reference leak on registration failure powerpc/ps3: use put_device() on device_register() failure in
ps3_system_bus_device_register

 arch/arm/common/locomo.c                 | 13 ++--
 arch/powerpc/platforms/ps3/device-init.c | 83 ++++++++++++++----------
 arch/powerpc/platforms/ps3/system-bus.c  |  2 +
 drivers/firmware/edd.c                   |  2 +-
 4 files changed, 59 insertions(+), 41 deletions(-)

base-commit: cee9395acd8043be0644b25c34bfa86623f2b935

Signature · 1 line
2.55.0.979.g7e5102b832-goog