backlight: replace kfree with put_device
Subsystems (2)
PATCH 1/1 backlight: replace kfree with put_device
As per the comments on device_register, we shouldn't call kfree() right after a device_register() failure. Instead call put_device(), which in turn will call bl_device_release resulting in a kfree to the full structure.
--- drivers/video/backlight/backlight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/backlight/backlight.c +1 -1
@@ -333,7 +333,7 @@ struct backlight_device *backlight_device_register(const char *name, rc =device_register (&new_bd->dev);if (rc) { -kfree (new_bd); +put_device (&new_bd->dev);return ERR_PTR (rc); }
Signature · 1 line
1.8.3.1
Quoted 7 lines · Levente Kurusa
As per the comments on
device_register, we shouldn't callkfree()right after adevice_register()failure. Instead callput_device(), which in turn will callbl_device_releaseresulting in a kfree to the full structure.Signed-off-by Levente Kurusa <[email protected]>
(+cc Bryan Wu, Lee Jones)
Best regards,
Jingoo Han
Quoted 19 lines
--- drivers/video/backlight/backlight.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/video/backlight/backlight.c +1
-2@@ -333,7 +333,7 @@ struct backlight_device *backlight_device_register(const char *name, rc =device_register (&new_bd->dev);if (rc) { -kfree (new_bd); +put_device (&new_bd->dev);return ERR_PTR (rc); } --1.8.3.1
Lee Jones
AppliedQuoted 10 lines
Quoted 6 lines
As per the comments on
device_register, we shouldn't callkfree()right after adevice_register()failure. Instead callput_device(), which in turn will callbl_device_releaseresulting in a kfree to the full structure.Signed-off-by Levente Kurusa <[email protected]>(+cc Bryan Wu, Lee Jones)
Acked-by Jingoo Han <[email protected]>
Applied to temporary Backlight repo [1], thanks.
[1] git://git.linaro.org/people/lee.jones/backlight.git
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
Quoted 7 lines · Lee Jones
Quoted 7 lines
Quoted 6 lines
As per the comments on
device_register, we shouldn't callkfree()right after adevice_register()failure. Instead callput_device(), which in turn will callbl_device_releaseresulting in a kfree to the full structure.Signed-off-by Levente Kurusa <[email protected]>
Quoted 8 lines
Quoted 3 lines
(+cc Bryan Wu, Lee Jones)
Acked-by Jingoo Han <[email protected]>Applied to temporary Backlight repo [1], thanks.
[1]
git://git.linaro.org/people/lee.jones/backlight.git
Great, I think we can put the Git URL into the MAINTAINS file for Backlight subsystem after your finalize the git repo.
Thanks,
-Bryan
Quoted 5 lines
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
Quoted 6 lines
As per the comments on
device_register, we shouldn't callkfree()right after adevice_register()failure. Instead callput_device(), which in turn will callbl_device_releaseresulting in a kfree to the full structure.Signed-off-by Levente Kurusa <[email protected]>(+cc Bryan Wu, Lee Jones)
Acked-by Jingoo Han <[email protected]>
Quoted 7 lines
Quoted 4 lines
Applied to temporary Backlight repo [1], thanks.
[1]
git://git.linaro.org/people/lee.jones/backlight.gitGreat, I think we can put the Git URL into the MAINTAINS file for Backlight subsystem after your finalize the git repo.
Right, I plan do to this for MFD too. Before doing so I need to load my GPG Key with lots of signatures, at Linus' request. I'm aiming for the end of the month(ish).
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog