Displaying 16 results from an estimated 16 matches for "dinghao".
Did you mean:
dingbao
2020 May 29
2
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new
When gk20a_clk_ctor() returns an error code, pointer "clk"
should be released. It's the same when gm20b_clk_new()
returns from elsewhere following this call.
Signed-off-by: Dinghao Liu <dinghao.liu at zju.edu.cn>
---
drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c b/drivers/gpu/drm/nouveau/nvkm/subdev/clk/gm20b.c
index b284e949f732..a5aeba74d3b7 1...
2020 May 20
1
[PATCH] drm/nouveau/dispnv50: fix runtime pm imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu at zju.edu.cn>
---
drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
index 6be9df1820c5..e670756664ff 100644
--- a/drivers/gpu/drm/n...
2020 Jun 01
2
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new
...now if -ENOMEM comes from the failure of kzalloc or gk20a_clk_ctor).
If the core always calls the destructor as long as the constructor
fails (even if the kzalloc fails), we may have a double free bug.
Would you like to give a more detailed explanation about the behavior
of the core?
Regards,
Dinghao
2020 May 31
0
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new
On Sat, 30 May 2020 at 19:42, Dinghao Liu <dinghao.liu at zju.edu.cn> wrote:
>
> When gk20a_clk_ctor() returns an error code, pointer "clk"
> should be released. It's the same when gm20b_clk_new()
> returns from elsewhere following this call.
This shouldn't be necessary. If a subdev constructor fail...
2020 Jun 01
1
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new
On Mon, 1 Jun 2020 at 13:37, Ben Skeggs <skeggsb at gmail.com> wrote:
>
> On Mon, 1 Jun 2020 at 13:27, <dinghao.liu at zju.edu.cn> wrote:
> >
> >
> > Hi Ben,
> >
> > > > When gk20a_clk_ctor() returns an error code, pointer "clk"
> > > > should be released. It's the same when gm20b_clk_new()
> > > > returns from elsewhere following t...
2020 May 20
0
[PATCH] drm/nouveau: fix runtime pm imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu at zju.edu.cn>
---
drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index f5ece1f94973..6697f960dd89 100644
--- a/drivers/gpu/drm/nouveau...
2020 May 20
0
[PATCH] drm/nouveau/debugfs: fix runtime pm imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu at zju.edu.cn>
---
drivers/gpu/drm/nouveau/nouveau_debugfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
index 15a3d40edf02..db3711436577 100644
--- a/drivers/gp...
2020 May 20
0
[PATCH] drm/nouveau: fix runtime pm imbalance on error
pm_runtime_get_sync() increments the runtime PM usage counter even
the call returns an error code. Thus a pairing decrement is needed
on the error handling path to keep the counter balanced.
Signed-off-by: Dinghao Liu <dinghao.liu at zju.edu.cn>
---
drivers/gpu/drm/nouveau/nouveau_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
index f5ece1f94973..125cefbb6210 100644
--- a/drivers/gpu/drm/nouveau/no...
2020 Jun 01
0
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new
On Mon, 1 Jun 2020 at 13:27, <dinghao.liu at zju.edu.cn> wrote:
>
>
> Hi Ben,
>
> > > When gk20a_clk_ctor() returns an error code, pointer "clk"
> > > should be released. It's the same when gm20b_clk_new()
> > > returns from elsewhere following this call.
> > This shouldn...
2020 May 31
1
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
...inter, though I could not find
the exact usage yet. For security, I will release this pointer only on error
paths in this function.
>
> Would you like to add the tag ?Fixes? to the commit message?
>
Thank you for your advice! I will add this tag in the next version of patch.
Regards,
Dinghao
2020 May 31
2
drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
...ase objects (which are referenced by pointers)?
>
I just found that clk is referenced by pclk in this function. When clk is freed,
pclk will be allocated in gm20b_clk_new_speedo0(). Thus we should not release clk
in this function and there is no bug here. Thank you for reminding me!
Regards,
Dinghao
2020 May 31
2
drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
...gt;
I think this mainly depends on pclk pointer. It seems that the caller of
gm20b_clk_new() always expects pclk to be allocated unless it returns -ENOMEM,
which means kzalloc() failed. If gk20a_clk_ctor() never returns such an error
code, we may need not to release this clock object.
Regards,
Dinghao
2020 May 31
3
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
> When gk20a_clk_ctor() returns an error code, pointer "clk"
> should be released.
Such an information is reasonable.
> It's the same when gm20b_clk_new() returns from elsewhere following this call.
I suggest to reconsider the interpretation of the software situation once more.
Can it be that the allocated clock object should be kept usable even after
a successful return
2020 Jun 02
2
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
On Tue, Jun 02, 2020 at 01:10:34PM +0200, Markus Elfring wrote:
> > The original patch was basically fine.
>
> I propose to reconsider the interpretation of the software situation once more.
>
> * Should the allocated clock object be kept usable even after
> a successful return from this function?
Heh. You're right. The patch is freeing "clk" on the
2020 May 31
1
drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
...luenced if there is a failed
kzalloc inside which.
In this case, maybe we should check the return value of
gk20a_clk_ctor() and release clk if it returns -ENOMEM.
And many other functions also have the same issue (e.g.,
gm20b_clk_new_speedo0). Do you have any idea about this
problem?
Regards,
Dinghao
2020 Jun 03
0
[PATCH] drm/nouveau/clk/gm20b: Fix memory leak in gm20b_clk_new()
...ess path so
> that doesn't work.
>
Ben has explained this problem:
https://lore.kernel.org/patchwork/patch/1249592/
Since the caller will check "pclk" on failure, we don't need to free
"clk" in gm20b_clk_new() and I think this patch is no longer needed.
Regards,
Dinghao