Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

7 messages, 3 authors, 2020-08-28 · open the first message on its own page

Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: Lee Jones <hidden>
Date: 2020-08-19 16:57:37

On Wed, 19 Aug 2020, Markus Elfring wrote:
quoted
When of_property_read_u32_array() returns an error code,
a pairing refcount decrement is needed to keep np's refcount balanced.
Can another imperative wording be helpful for the change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id445bf405cb331117bc98427b1ba6f12418ad17#n151

Would an other commit message be a bit nicer?


…
quoted
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -217,6 +217,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
 					num_entry);
 		if (ret < 0) {
 			dev_err(dev, "led-sources node is invalid.\n");
+			of_node_put(np);
 			return ERR_PTR(-EINVAL);
 		}
I propose to add the jump target “put_node” so that a bit of common exception
handling code can be better reused at the end of this function implementation.

Regards,
Markus
You can safely ignore any review comments from Markus!

However, this patch doesn't appear to be in my inbox.

Any ideas as to why?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Re: Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: <hidden>
Date: 2020-08-20 03:51:02

PiBPbiBXZWQsIDE5IEF1ZyAyMDIwLCBNYXJrdXMgRWxmcmluZyB3cm90ZToKPiAKPiA+ID4gV2hl
biBvZl9wcm9wZXJ0eV9yZWFkX3UzMl9hcnJheSgpIHJldHVybnMgYW4gZXJyb3IgY29kZSwKPiA+
ID4gYSBwYWlyaW5nIHJlZmNvdW50IGRlY3JlbWVudCBpcyBuZWVkZWQgdG8ga2VlcCBucCdzIHJl
ZmNvdW50IGJhbGFuY2VkLgo+ID4gCj4gPiBDYW4gYW5vdGhlciBpbXBlcmF0aXZlIHdvcmRpbmcg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Cj4gPiAKPiA+IFJlZ2FyZHMs
Cj4gPiBNYXJrdXMKPiAKPiBZb3UgY2FuIHNhZmVseSBpZ25vcmUgYW55IHJldmlldyBjb21tZW50
cyBmcm9tIE1hcmt1cyEKPiAKPiBIb3dldmVyLCB0aGlzIHBhdGNoIGRvZXNuJ3QgYXBwZWFyIHRv
IGJlIGluIG15IGluYm94Lgo+IAo+IEFueSBpZGVhcyBhcyB0byB3aHk/Cj4gCj4gLS0gCj4gTGVl
IEpvbmVzIFvmnY7nkLzmlq9dCj4gU2VuaW9yIFRlY2huaWNhbCBMZWFkIC0gRGV2ZWxvcGVyIFNl
cnZpY2VzCj4gTGluYXJvLm9yZyDilIIgT3BlbiBzb3VyY2Ugc29mdHdhcmUgZm9yIEFybSBTb0Nz
Cj4gRm9sbG93IExpbmFybzogRmFjZWJvb2sgfCBUd2l0dGVyIHwgQmxvZwoKVGhhbmsgeW91IGZv
ciB5b3VyIGFkdmljZS4gTXkgb3V0Ym94IHNob3dzIHRoYXQgdGhpcyBwYXRjaApoYXMgcmVhY2hl
ZCB5b3VyIGVtYWlsIHNlcnZlciBzdWNjZXNzZnVsbHkuIE1heWJlIHRoaXMKZW5kZWQgdXAgaW4g
eW91ciBqdW5rIG1haWwgZmlsZT8KClJlZ2FyZHMsCkRpbmdoYW8

Re: Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: Lee Jones <hidden>
Date: 2020-08-20 06:23:10

On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
On Wed, 19 Aug 2020, Markus Elfring wrote:
quoted
quoted
When of_property_read_u32_array() returns an error code,
a pairing refcount decrement is needed to keep np's refcount balanced.
Can another imperative wording be helpful for the change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id445bf405cb331117bc98427b1ba6f12418ad17#n151

Would an other commit message be a bit nicer?


…
quoted
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -217,6 +217,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
 					num_entry);
 		if (ret < 0) {
 			dev_err(dev, "led-sources node is invalid.\n");
+			of_node_put(np);
 			return ERR_PTR(-EINVAL);
 		}
I propose to add the jump target “put_node” so that a bit of common exception
handling code can be better reused at the end of this function implementation.

Regards,
Markus
You can safely ignore any review comments from Markus!

However, this patch doesn't appear to be in my inbox.

Any ideas as to why?
Thank you for your advice. My outbox shows that this patch
has reached your email server successfully. Maybe this
ended up in your junk mail file?
This has happened recently, so I was sure to check.

Not there either unfortunately.

Would you be kind enough to bounce/resend please?

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Re: Re: Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: <hidden>
Date: 2020-08-20 06:36:54

PiBPbiBUaHUsIDIwIEF1ZyAyMDIwLCBkaW5naGFvLmxpdUB6anUuZWR1LmNuIHdyb3RlOgo+IAo+
ID4gPiBPbiBXZWQsIDE5IEF1ZyAyMDIwLCBNYXJrdXMgRWxmcmluZyB3cm90ZToKPiA+ID4gCj4g
PiA+ID4gPiBXaGVuIG9mX3Byb3BlcnR5X3JlYWRfdTMyX2FycmF5KCkgcmV0dXJucyBhbiBlcnJv
ciBjb2RlLAo+ID4gPiA+ID4gYSBwYWlyaW5nIHJlZmNvdW50IGRlY3JlbWVudCBpcyBuZWVkZWQg
dG8ga2VlcCBucCdzIHJlZmNvdW50IGJhbGFuY2VkLgo+ID4gPiA+IAo+ID4gPiA+IENhbiBhbm90
aGVyIGltcGVyYXRpdmUgd29yZGluZyBiZSBoZWxwZnVsIGZvciB0aGUgY2hhbmdlIGRlc2NyaXB0
aW9uPwo+ID4gPiA+IGh0dHBzOi8vZ2l0Lmtlcm5lbC5vcmcvcHViL3NjbS9saW51eC9rZXJuZWwv
Z2l0L3RvcnZhbGRzL2xpbnV4LmdpdC90cmVlL0RvY3VtZW50Y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+ID4gPiBZb3UgY2FuIHNhZmVseSBpZ25vcmUgYW55IHJldmlldyBjb21tZW50cyBm
cm9tIE1hcmt1cyEKPiA+ID4gCj4gPiA+IEhvd2V2ZXIsIHRoaXMgcGF0Y2ggZG9lc24ndCBhcHBl
YXIgdG8gYmUgaW4gbXkgaW5ib3guCj4gPiA+IAo+ID4gPiBBbnkgaWRlYXMgYXMgdG8gd2h5Pwo+
ID4gPiAKPiA+IAo+ID4gVGhhbmsgeW91IGZvciB5b3VyIGFkdmljZS4gTXkgb3V0Ym94IHNob3dz
IHRoYXQgdGhpcyBwYXRjaAo+ID4gaGFzIHJlYWNoZWQgeW91ciBlbWFpbCBzZXJ2ZXIgc3VjY2Vz
c2Z1bGx5LiBNYXliZSB0aGlzCj4gPiBlbmRlZCB1cCBpbiB5b3VyIGp1bmsgbWFpbCBmaWxlPwo+
IAo+IFRoaXMgaGFzIGhhcHBlbmVkIHJlY2VudGx5LCBzbyBJIHdhcyBzdXJlIHRvIGNoZWNrLgo+
IAo+IE5vdCB0aGVyZSBlaXRoZXIgdW5mb3J0dW5hdGVseS4KPiAKPiBXb3VsZCB5b3UgYmUga2lu
ZCBlbm91Z2ggdG8gYm91bmNlL3Jlc2VuZCBwbGVhc2U/Cj4gCgpTdXJlLgo

Re: Re: Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: Lee Jones <hidden>
Date: 2020-08-20 07:49:30

On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
quoted
On Wed, 19 Aug 2020, Markus Elfring wrote:
quoted
quoted
When of_property_read_u32_array() returns an error code,
a pairing refcount decrement is needed to keep np's refcount balanced.
Can another imperative wording be helpful for the change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id445bf405cb331117bc98427b1ba6f12418ad17#n151

Would an other commit message be a bit nicer?


…
quoted
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -217,6 +217,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
 					num_entry);
 		if (ret < 0) {
 			dev_err(dev, "led-sources node is invalid.\n");
+			of_node_put(np);
 			return ERR_PTR(-EINVAL);
 		}
I propose to add the jump target “put_node” so that a bit of common exception
handling code can be better reused at the end of this function implementation.

Regards,
Markus
You can safely ignore any review comments from Markus!

However, this patch doesn't appear to be in my inbox.

Any ideas as to why?
Thank you for your advice. My outbox shows that this patch
has reached your email server successfully. Maybe this
ended up in your junk mail file?
This has happened recently, so I was sure to check.

Not there either unfortunately.

Would you be kind enough to bounce/resend please?
Sure.
Looks like you sent it *only* to me.  Please keep everyone else in Cc
when doing that, or I can't respond to everyone.

Anyway, besides the subject line (which I can fix easily), the patch
looks good to me, but Daniel T must review.

Reviewed-by: Lee Jones <redacted>

--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: Daniel Thompson <hidden>
Date: 2020-08-20 11:38:39

On Thu, Aug 20, 2020 at 08:49:16AM +0100, Lee Jones wrote:
On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
quoted
On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
quoted
On Wed, 19 Aug 2020, Markus Elfring wrote:
quoted
quoted
When of_property_read_u32_array() returns an error code,
a pairing refcount decrement is needed to keep np's refcount balanced.
Can another imperative wording be helpful for the change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id445bf405cb331117bc98427b1ba6f12418ad17#n151

Would an other commit message be a bit nicer?


…
quoted
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -217,6 +217,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
 					num_entry);
 		if (ret < 0) {
 			dev_err(dev, "led-sources node is invalid.\n");
+			of_node_put(np);
 			return ERR_PTR(-EINVAL);
 		}
I propose to add the jump target “put_node” so that a bit of common exception
handling code can be better reused at the end of this function implementation.

Regards,
Markus
You can safely ignore any review comments from Markus!

However, this patch doesn't appear to be in my inbox.

Any ideas as to why?
Thank you for your advice. My outbox shows that this patch
has reached your email server successfully. Maybe this
ended up in your junk mail file?
This has happened recently, so I was sure to check.

Not there either unfortunately.

Would you be kind enough to bounce/resend please?
Sure.
Looks like you sent it *only* to me.  Please keep everyone else in Cc
when doing that, or I can't respond to everyone.

Anyway, besides the subject line (which I can fix easily), the patch
looks good to me, but Daniel T must review.
I've already offered a Reviewed-by for this patch. Perhaps it landed in
the same place as the original patch...


Daniel.
Reviewed-by: Lee Jones <redacted>
--
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

Re: [PATCH] video: backlight: sky81452-backlight: Fix reference count imbalance on error

From: Lee Jones <hidden>
Date: 2020-08-28 09:29:16

On Thu, 20 Aug 2020, Daniel Thompson wrote:
On Thu, Aug 20, 2020 at 08:49:16AM +0100, Lee Jones wrote:
quoted
On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
quoted
On Thu, 20 Aug 2020, dinghao.liu@zju.edu.cn wrote:
quoted
quoted
On Wed, 19 Aug 2020, Markus Elfring wrote:
quoted
quoted
When of_property_read_u32_array() returns an error code,
a pairing refcount decrement is needed to keep np's refcount balanced.
Can another imperative wording be helpful for the change description?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?id445bf405cb331117bc98427b1ba6f12418ad17#n151

Would an other commit message be a bit nicer?


…
quoted
+++ b/drivers/video/backlight/sky81452-backlight.c
@@ -217,6 +217,7 @@ static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
 					num_entry);
 		if (ret < 0) {
 			dev_err(dev, "led-sources node is invalid.\n");
+			of_node_put(np);
 			return ERR_PTR(-EINVAL);
 		}
I propose to add the jump target “put_node” so that a bit of common exception
handling code can be better reused at the end of this function implementation.

Regards,
Markus
You can safely ignore any review comments from Markus!

However, this patch doesn't appear to be in my inbox.

Any ideas as to why?
Thank you for your advice. My outbox shows that this patch
has reached your email server successfully. Maybe this
ended up in your junk mail file?
This has happened recently, so I was sure to check.

Not there either unfortunately.

Would you be kind enough to bounce/resend please?
Sure.
Looks like you sent it *only* to me.  Please keep everyone else in Cc
when doing that, or I can't respond to everyone.

Anyway, besides the subject line (which I can fix easily), the patch
looks good to me, but Daniel T must review.
I've already offered a Reviewed-by for this patch. Perhaps it landed in
the same place as the original patch...
Patch applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help