* [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-13 11:17 ` Christophe JAILLET
0 siblings, 0 replies; 11+ messages in thread
From: Christophe JAILLET @ 2018-05-13 11:17 UTC (permalink / raw)
To: mturquette, sboyd, mcoquelin.stm32, alexandre.torgue
Cc: linux-clk, linux-arm-kernel, linux-kernel, kernel-janitors,
Christophe JAILLET
We allocate some memory which is neither used, nor referenced by anything.
So axe it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch as not been compile-tested, I don't have the corresponding arch
and have not taken time to cross-compile it.
---
drivers/clk/clk-stm32mp1.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index edd3cf451401..dfb9cb5bd0c4 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev,
spinlock_t *lock)
{
struct clk_init_data init = { NULL };
- struct clk_gate *gate;
struct clk_hw *hw;
int ret;
- gate = kzalloc(sizeof(*gate), GFP_KERNEL);
- if (!gate)
- return ERR_PTR(-ENOMEM);
-
init.name = name;
init.parent_names = &parent_name;
init.num_parents = 1;
@@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev,
hw->init = &init;
ret = clk_hw_register(dev, hw);
- if (ret) {
- kfree(gate);
+ if (ret)
hw = ERR_PTR(ret);
- }
return hw;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-13 11:17 ` Christophe JAILLET
0 siblings, 0 replies; 11+ messages in thread
From: Christophe JAILLET @ 2018-05-13 11:17 UTC (permalink / raw)
To: linux-arm-kernel
We allocate some memory which is neither used, nor referenced by anything.
So axe it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch as not been compile-tested, I don't have the corresponding arch
and have not taken time to cross-compile it.
---
drivers/clk/clk-stm32mp1.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index edd3cf451401..dfb9cb5bd0c4 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev,
spinlock_t *lock)
{
struct clk_init_data init = { NULL };
- struct clk_gate *gate;
struct clk_hw *hw;
int ret;
- gate = kzalloc(sizeof(*gate), GFP_KERNEL);
- if (!gate)
- return ERR_PTR(-ENOMEM);
-
init.name = name;
init.parent_names = &parent_name;
init.num_parents = 1;
@@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev,
hw->init = &init;
ret = clk_hw_register(dev, hw);
- if (ret) {
- kfree(gate);
+ if (ret)
hw = ERR_PTR(ret);
- }
return hw;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-13 11:17 ` Christophe JAILLET
0 siblings, 0 replies; 11+ messages in thread
From: Christophe JAILLET @ 2018-05-13 11:17 UTC (permalink / raw)
To: linux-arm-kernel
We allocate some memory which is neither used, nor referenced by anything.
So axe it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
This patch as not been compile-tested, I don't have the corresponding arch
and have not taken time to cross-compile it.
---
drivers/clk/clk-stm32mp1.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
index edd3cf451401..dfb9cb5bd0c4 100644
--- a/drivers/clk/clk-stm32mp1.c
+++ b/drivers/clk/clk-stm32mp1.c
@@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev,
spinlock_t *lock)
{
struct clk_init_data init = { NULL };
- struct clk_gate *gate;
struct clk_hw *hw;
int ret;
- gate = kzalloc(sizeof(*gate), GFP_KERNEL);
- if (!gate)
- return ERR_PTR(-ENOMEM);
-
init.name = name;
init.parent_names = &parent_name;
init.num_parents = 1;
@@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev,
hw->init = &init;
ret = clk_hw_register(dev, hw);
- if (ret) {
- kfree(gate);
+ if (ret)
hw = ERR_PTR(ret);
- }
return hw;
}
--
2.17.0
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
2018-05-13 11:17 ` Christophe JAILLET
(?)
(?)
@ 2018-05-14 8:50 ` Gabriel FERNANDEZ
-1 siblings, 0 replies; 11+ messages in thread
From: Gabriel FERNANDEZ @ 2018-05-14 8:50 UTC (permalink / raw)
To: Christophe Jaillet, mturquette, sboyd, mcoquelin.stm32, Alexandre TORGUE
Cc: linux-clk, linux-arm-kernel, linux-kernel, kernel-janitors
Hi Christophe,
Many thanks !
Acked-by: Gabriel Fernandez <gabriel.fernandez@st.com>
On 05/13/2018 01:17 PM, Christophe Jaillet wrote:
> We allocate some memory which is neither used, nor referenced by anything.
> So axe it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch as not been compile-tested, I don't have the corresponding arch
> and have not taken time to cross-compile it.
> ---
> drivers/clk/clk-stm32mp1.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
> index edd3cf451401..dfb9cb5bd0c4 100644
> --- a/drivers/clk/clk-stm32mp1.c
> +++ b/drivers/clk/clk-stm32mp1.c
> @@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev,
> spinlock_t *lock)
> {
> struct clk_init_data init = { NULL };
> - struct clk_gate *gate;
> struct clk_hw *hw;
> int ret;
>
> - gate = kzalloc(sizeof(*gate), GFP_KERNEL);
> - if (!gate)
> - return ERR_PTR(-ENOMEM);
> -
> init.name = name;
> init.parent_names = &parent_name;
> init.num_parents = 1;
> @@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev,
> hw->init = &init;
>
> ret = clk_hw_register(dev, hw);
> - if (ret) {
> - kfree(gate);
> + if (ret)
> hw = ERR_PTR(ret);
> - }
>
> return hw;
> }
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-14 8:50 ` Gabriel FERNANDEZ
0 siblings, 0 replies; 11+ messages in thread
From: Gabriel FERNANDEZ @ 2018-05-14 8:50 UTC (permalink / raw)
To: linux-arm-kernel
SGkgQ2hyaXN0b3BoZSwNCg0KTWFueSB0aGFua3MgIQ0KDQpBY2tlZC1ieTogR2FicmllbCBGZXJu
YW5kZXogPGdhYnJpZWwuZmVybmFuZGV6QHN0LmNvbT4NCg0KDQpPbiAwNS8xMy8yMDE4IDAxOjE3
IFBNLCBDaHJpc3RvcGhlIEphaWxsZXQgd3JvdGU6DQo+IFdlIGFsbG9jYXRlIHNvbWUgbWVtb3J5
IHdoaWNoIGlzIG5laXRoZXIgdXNlZCwgbm9yIHJlZmVyZW5jZWQgYnkgYW55dGhpbmcuDQo+IFNv
IGF4ZSBpdC4NCj4NCj4gU2lnbmVkLW9mZi1ieTogQ2hyaXN0b3BoZSBKQUlMTEVUIDxjaHJpc3Rv
cGhlLmphaWxsZXRAd2FuYWRvby5mcj4NCj4gLS0tDQo+IFRoaXMgcGF0Y2ggYXMgbm90IGJlZW4g
Y29tcGlsZS10ZXN0ZWQsIEkgZG9uJ3QgaGF2ZSB0aGUgY29ycmVzcG9uZGluZyBhcmNoDQo+IGFu
ZCBoYXZlIG5vdCB0YWtlbiB0aW1lIHRvIGNyb3NzLWNvbXBpbGUgaXQuDQo+IC0tLQ0KPiAgIGRy
aXZlcnMvY2xrL2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3LT5pbml0ID0gJmluaXQ7DQo+
ICAgDQo+ICAgCXJldCA9IGNsa19od19yZWdpc3RlcihkZXYsIGh3KTsNCj4gLQlpZiAocmV0KSB7
DQo+IC0JCWtmcmVlKGdhdGUpOw0KPiArCWlmIChyZXQpDQo+ICAgCQlodyA9IEVSUl9QVFIocmV0
KTsNCj4gLQl9DQo+ICAgDQo+ICAgCXJldHVybiBodzsNCj4gICB9DQo
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-14 8:50 ` Gabriel FERNANDEZ
0 siblings, 0 replies; 11+ messages in thread
From: Gabriel FERNANDEZ @ 2018-05-14 8:50 UTC (permalink / raw)
To: Christophe Jaillet, mturquette, sboyd, mcoquelin.stm32, Alexandre TORGUE
Cc: linux-clk, linux-arm-kernel, linux-kernel, kernel-janitors
SGkgQ2hyaXN0b3BoZSwNCg0KTWFueSB0aGFua3MgIQ0KDQpBY2tlZC1ieTogR2FicmllbCBGZXJu
YW5kZXogPGdhYnJpZWwuZmVybmFuZGV6QHN0LmNvbT4NCg0KDQpPbiAwNS8xMy8yMDE4IDAxOjE3
IFBNLCBDaHJpc3RvcGhlIEphaWxsZXQgd3JvdGU6DQo+IFdlIGFsbG9jYXRlIHNvbWUgbWVtb3J5
IHdoaWNoIGlzIG5laXRoZXIgdXNlZCwgbm9yIHJlZmVyZW5jZWQgYnkgYW55dGhpbmcuDQo+IFNv
IGF4ZSBpdC4NCj4NCj4gU2lnbmVkLW9mZi1ieTogQ2hyaXN0b3BoZSBKQUlMTEVUIDxjaHJpc3Rv
cGhlLmphaWxsZXRAd2FuYWRvby5mcj4NCj4gLS0tDQo+IFRoaXMgcGF0Y2ggYXMgbm90IGJlZW4g
Y29tcGlsZS10ZXN0ZWQsIEkgZG9uJ3QgaGF2ZSB0aGUgY29ycmVzcG9uZGluZyBhcmNoDQo+IGFu
ZCBoYXZlIG5vdCB0YWtlbiB0aW1lIH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yZWdpc3Rl
cl9nYXRlX29wcyhzdHJ1Y3QgZGV2aWNlICpkZXYsDQo+ICAgCWh3LT5pbml0ID0gJmluaXQ7DQo+
ICAgDQo+ICAgCXJldCA9IGNsa19od19yZWdpc3RlcihkZXYsIGh3KTsNCj4gLQlpZiAocmV0KSB7
DQo+IC0JCWtmcmVlKGdhdGUpOw0KPiArCWlmIChyZXQpDQo+ICAgCQlodyA9IEVSUl9QVFIocmV0
KTsNCj4gLQl9DQo+ICAgDQo+ICAgCXJldHVybiBodzsNCj4gICB9DQo=
^ permalink raw reply [flat|nested] 11+ messages in thread
* clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-14 8:50 ` Gabriel FERNANDEZ
0 siblings, 0 replies; 11+ messages in thread
From: Gabriel FERNANDEZ @ 2018-05-14 8:50 UTC (permalink / raw)
To: linux-arm-kernel
Hi Christophe,
Many thanks !
Acked-by: Gabriel Fernandez <gabriel.fernandez@st.com>
On 05/13/2018 01:17 PM, Christophe Jaillet wrote:
> We allocate some memory which is neither used, nor referenced by anything.
> So axe it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> This patch as not been compile-tested, I don't have the corresponding arch
> and have not taken time to cross-compile it.
> ---
> drivers/clk/clk-stm32mp1.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
>
> diff --git a/drivers/clk/clk-stm32mp1.c b/drivers/clk/clk-stm32mp1.c
> index edd3cf451401..dfb9cb5bd0c4 100644
> --- a/drivers/clk/clk-stm32mp1.c
> +++ b/drivers/clk/clk-stm32mp1.c
> @@ -579,14 +579,9 @@ clk_stm32_register_gate_ops(struct device *dev,
> spinlock_t *lock)
> {
> struct clk_init_data init = { NULL };
> - struct clk_gate *gate;
> struct clk_hw *hw;
> int ret;
>
> - gate = kzalloc(sizeof(*gate), GFP_KERNEL);
> - if (!gate)
> - return ERR_PTR(-ENOMEM);
> -
> init.name = name;
> init.parent_names = &parent_name;
> init.num_parents = 1;
> @@ -604,10 +599,8 @@ clk_stm32_register_gate_ops(struct device *dev,
> hw->init = &init;
>
> ret = clk_hw_register(dev, hw);
> - if (ret) {
> - kfree(gate);
> + if (ret)
> hw = ERR_PTR(ret);
> - }
>
> return hw;
> }
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
2018-05-13 11:17 ` Christophe JAILLET
(?)
(?)
@ 2018-05-15 20:37 ` Stephen Boyd
-1 siblings, 0 replies; 11+ messages in thread
From: Stephen Boyd @ 2018-05-15 20:37 UTC (permalink / raw)
To: Christophe JAILLET, alexandre.torgue, mcoquelin.stm32, mturquette
Cc: linux-clk, linux-arm-kernel, linux-kernel, kernel-janitors,
Christophe JAILLET
Quoting Christophe JAILLET (2018-05-13 04:17:04)
> We allocate some memory which is neither used, nor referenced by anything.
> So axe it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-15 20:37 ` Stephen Boyd
0 siblings, 0 replies; 11+ messages in thread
From: Stephen Boyd @ 2018-05-15 20:37 UTC (permalink / raw)
To: linux-arm-kernel
Quoting Christophe JAILLET (2018-05-13 04:17:04)
> We allocate some memory which is neither used, nor referenced by anything.
> So axe it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-15 20:37 ` Stephen Boyd
0 siblings, 0 replies; 11+ messages in thread
From: Stephen Boyd @ 2018-05-15 20:37 UTC (permalink / raw)
To: Christophe JAILLET, alexandre.torgue, mcoquelin.stm32, mturquette
Cc: linux-clk, linux-arm-kernel, linux-kernel, kernel-janitors,
Christophe JAILLET
Quoting Christophe JAILLET (2018-05-13 04:17:04)
> We allocate some memory which is neither used, nor referenced by anything.
> So axe it.
> =
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()'
@ 2018-05-15 20:37 ` Stephen Boyd
0 siblings, 0 replies; 11+ messages in thread
From: Stephen Boyd @ 2018-05-15 20:37 UTC (permalink / raw)
To: linux-arm-kernel
Quoting Christophe JAILLET (2018-05-13 04:17:04)
> We allocate some memory which is neither used, nor referenced by anything.
> So axe it.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-05-15 20:37 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-13 11:17 [PATCH] clk: stm32mp1: Fix a memory leak in 'clk_stm32_register_gate_ops()' Christophe JAILLET
2018-05-13 11:17 ` Christophe JAILLET
2018-05-13 11:17 ` Christophe JAILLET
2018-05-14 8:50 ` Gabriel FERNANDEZ
2018-05-14 8:50 ` Gabriel FERNANDEZ
2018-05-14 8:50 ` Gabriel FERNANDEZ
2018-05-14 8:50 ` Gabriel FERNANDEZ
2018-05-15 20:37 ` [PATCH] " Stephen Boyd
2018-05-15 20:37 ` Stephen Boyd
2018-05-15 20:37 ` Stephen Boyd
2018-05-15 20:37 ` Stephen Boyd
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.