From 4fe34831e2e7677b1c9616356f0a2e0a36ec092f Mon Sep 17 00:00:00 2001
From: Jesper Juhl
Date: Thu, 16 Feb 2023 02:33:05 +0100
Subject: [PATCH] Don't test for NULL firmware before releasing
release_firmware() tests for a NULL pointer itself, no need to do it up-front.
Signed-off-by: J
7;
label - kfree() deals gracefully with NULL pointers, so it is not
needed.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/psb_intel_lvds.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
I considered adding a new label at the end and use a goto instead, but
settled on this
In sis_driver_load(), the only use of 'ret' is as the return value
from the function, unfortunately it is never initialized, so the
function just returns garbage when it succeeds.
To fix that, remove the variable and just return 0 directly on success.
Signed-off-by: Jesper Juhl
---
d
On Sat, 14 Jan 2012, Jesper Juhl wrote:
> In psb_intel_lvds_init(), if we fail to allocate memory for
> 'psb_intel_connector' we free the memory we previously allocated for
> 'psb_intel_encoder', but we then proceed to use that free'd pointer
> when we do
el - kfree() deals gracefully with NULL pointers, so it is not
needed.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/psb_intel_lvds.c |9 -
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c
b/drivers/gpu/drm/gma5
On Tue, 17 Jan 2012, Patrik Jakobsson wrote:
> On Sat, Jan 14, 2012 at 10:15 PM, Jesper Juhl wrote:
> > In psb_intel_lvds_init(), if we fail to allocate memory for
> > 'psb_intel_connector' we free the memory we previously allocated for
> > 'psb_intel_encod
On Sun, 5 Feb 2012, Masanari Iida wrote:
> Correct spelling "unsuported" to "unsupported" in
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>
> Signed-off-by: Masanari Iida
Reviewed-by: Jesper Juhl
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |2 +-
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/power.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c
index 9402569..6486f61 100644
--- a/drivers/gpu/drm/gma500/power.c
+++ b/drivers/gpu/drm
return statement needs just one semi-colon
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/radeon/radeon_gart.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c
b/drivers/gpu/drm/radeon/radeon_gart.c
index 010dad8..d5b1adc 100644
--- a
Remove redundant NULL checks before kfree() in
drivers/gpu/drm/nouveau/nvc0_graph.c
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/nouveau/nvc0_graph.c |9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c
b/drivers/gpu/drm/nouveau
release_firmware() does its own tests for NULL pointers so there's no
need to explicitly test before calling it.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/radeon/radeon_cp.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/r
drivers/gpu/drm/gma500/mdfld_dsi_output.h does not need to
'#include ' - so don't.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/mdfld_dsi_output.h |1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.h
b/drivers
First we allocate memory for 'sysram' with vmalloc() and subsequently
we allocate for 'info' with framebuffer_alloc(). If the second
allocation fails we return -ENOMEM, but neglect to vfree() the memory
we previously allocated for 'sysram', thus leaking i
On Fri, 22 Jun 2012, devendra.aaru wrote:
> On Fri, Jun 22, 2012 at 3:43 AM, Jesper Juhl wrote:
> > First we allocate memory for 'sysram' with vmalloc() and subsequently
> > we allocate for 'info' with framebuffer_alloc(). If the second
> > allocatio
If we ever hit the default case in the switch statement we'll return
from the function without freeing the memory we just allocated to
'intel_plane' (but that has not been used).
This patch gets rid of the leak by freeing the memory just before we
return.
Signed-off-by: Jesper Juh
am' if the framebuffer_alloc()
call fails and the variable goes out of scope.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/ast/ast_fb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index 2fc8e9e..260a760 100644
--- a/driv
fails then we'll leak the memory allocated for 'sysram'
with vmalloc().
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
b/drivers/gpu/drm/cirrus/cirru
If the allocation of 'buf' succeeds but the allocation of 'msgs' fails
we'll return false and leak 'buf' when it goes out of scope.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/i915/intel_sdvo.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions
On Sun, 5 Aug 2012, Daniel Vetter wrote:
> On Tue, Jul 31, 2012 at 10:31:15PM +0200, Jesper Juhl wrote:
> > If the allocation of 'buf' succeeds but the allocation of 'msgs' fails
> > we'll return false and leak 'buf' when it goes out of sco
It seems to me that we are leaking 'user_pages' in
drivers/gpu/drm/i915/i915_gem.c::i915_gem_shmem_pread_slow() if
read_cache_page_gfp() fails.
Signed-off-by: Jesper Juhl
---
i915_gem.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Untested patch - user be warned.
If nva3_calc_pll() returns less than 0 in
drivers/gpu/drm/nouveau/nva3_pm.c:nva3_pm_clock_pre() we'll return
without freeing 'pll'.
This patch should fix the leak.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/nouveau/nva3_pm.c |4 +++-
1 files changed, 3 insertions(
o be able to tell which
branch created the error which is impossible if the error messages are
100% identical.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/nouveau/nv20_graph.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
Don't have the hardware, so compile tested only.
d
On Sun, 3 Jul 2011, Paul Menzel wrote:
> Dear Jesper,
>
>
> Am Sonntag, den 03.07.2011, 12:25 +0200 schrieb Jesper Juhl:
> > If we return due to an unknown chipset in
> > drivers/gpu/drm/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the
> > memory a
On Sun, 3 Jul 2011, Jesper Juhl wrote:
> On Sun, 3 Jul 2011, Paul Menzel wrote:
>
> > Dear Jesper,
> >
> >
> > Am Sonntag, den 03.07.2011, 12:25 +0200 schrieb Jesper Juhl:
> > > If we return due to an unknown chipset in
> > > drivers/gpu/drm/nou
Hi,
The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.
This patch removes such casts from drivers/gpu/drm/
Signed-off-by: Jesper Juhl
---
drm_sman.c |4 +---
1
complaining about leaked memory and missing fclose() calls and
it also seems to be the prefered style of the existing code to explicitly
close the file.
So, here's a patch to add the two missing fclose() calls.
Signed-off-by: Jesper Juhl
---
mkregtable.c |5 -
1 file changed, 4 inser
release_firmware() does its own tests for NULL pointers so there's no
need to explicitly test before calling it.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/radeon/radeon_cp.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/r
drivers/gpu/drm/gma500/mdfld_dsi_output.h does not need to
'#include ' - so don't.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/mdfld_dsi_output.h |1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/gpu/drm/gma500/mdfld_dsi_output.h
b/drivers
On Sun, 5 Aug 2012, Daniel Vetter wrote:
> On Tue, Jul 31, 2012 at 10:31:15PM +0200, Jesper Juhl wrote:
> > If the allocation of 'buf' succeeds but the allocation of 'msgs' fails
> > we'll return false and leak 'buf' when it goes out of sco
On Sun, 5 Feb 2012, Masanari Iida wrote:
> Correct spelling "unsuported" to "unsupported" in
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
>
> Signed-off-by: Masanari Iida
Reviewed-by: Jesper Juhl
> ---
> drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |2 +-
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/power.c |5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/gma500/power.c b/drivers/gpu/drm/gma500/power.c
index 9402569..6486f61 100644
--- a/drivers/gpu/drm/gma500/power.c
+++ b/drivers/gpu/drm
return statement needs just one semi-colon
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/radeon/radeon_gart.c |2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/radeon/radeon_gart.c
b/drivers/gpu/drm/radeon/radeon_gart.c
index 010dad8..d5b1adc 100644
--- a
7;
label - kfree() deals gracefully with NULL pointers, so it is not
needed.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/psb_intel_lvds.c |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
I considered adding a new label at the end and use a goto instead, but
settled on this
In sis_driver_load(), the only use of 'ret' is as the return value
from the function, unfortunately it is never initialized, so the
function just returns garbage when it succeeds.
To fix that, remove the variable and just return 0 directly on success.
Signed-off-by: Jesper Juhl
---
d
On Sat, 14 Jan 2012, Jesper Juhl wrote:
> In psb_intel_lvds_init(), if we fail to allocate memory for
> 'psb_intel_connector' we free the memory we previously allocated for
> 'psb_intel_encoder', but we then proceed to use that free'd pointer
> when we do
el - kfree() deals gracefully with NULL pointers, so it is not
needed.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/gma500/psb_intel_lvds.c |9 -
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c
b/drivers/gpu/drm/gma5
On Tue, 17 Jan 2012, Patrik Jakobsson wrote:
> On Sat, Jan 14, 2012 at 10:15 PM, Jesper Juhl wrote:
> > In psb_intel_lvds_init(), if we fail to allocate memory for
> > 'psb_intel_connector' we free the memory we previously allocated for
> > 'psb_intel_encod
complaining about leaked memory and missing fclose() calls and
it also seems to be the prefered style of the existing code to explicitly
close the file.
So, here's a patch to add the two missing fclose() calls.
Signed-off-by: Jesper Juhl
---
mkregtable.c |5 -
1 file changed, 4 inser
Hi,
The [vk][cmz]alloc(_node) family of functions return void pointers which
it's completely unnecessary/pointless to cast to other pointer types since
that happens implicitly.
This patch removes such casts from drivers/gpu/drm/
Signed-off-by: Jesper Juhl
---
drm_sman.c |4 +---
1
If nva3_calc_pll() returns less than 0 in
drivers/gpu/drm/nouveau/nva3_pm.c:nva3_pm_clock_pre() we'll return
without freeing 'pll'.
This patch should fix the leak.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/nouveau/nva3_pm.c |4 +++-
1 files changed, 3 insertions(
o be able to tell which
branch created the error which is impossible if the error messages are
100% identical.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/nouveau/nv20_graph.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
Don't have the hardware, so compile tested only.
d
On Sun, 3 Jul 2011, Paul Menzel wrote:
> Dear Jesper,
>
>
> Am Sonntag, den 03.07.2011, 12:25 +0200 schrieb Jesper Juhl:
> > If we return due to an unknown chipset in
> > drivers/gpu/drm/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the
> > memory a
On Sun, 3 Jul 2011, Jesper Juhl wrote:
> On Sun, 3 Jul 2011, Paul Menzel wrote:
>
> > Dear Jesper,
> >
> >
> > Am Sonntag, den 03.07.2011, 12:25 +0200 schrieb Jesper Juhl:
> > > If we return due to an unknown chipset in
> > > drivers/gpu/drm/nou
It seems to me that we are leaking 'user_pages' in
drivers/gpu/drm/i915/i915_gem.c::i915_gem_shmem_pread_slow() if
read_cache_page_gfp() fails.
Signed-off-by: Jesper Juhl
---
i915_gem.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Untested patch - user be warned.
am' if the framebuffer_alloc()
call fails and the variable goes out of scope.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/ast/ast_fb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/ast/ast_fb.c b/drivers/gpu/drm/ast/ast_fb.c
index 2fc8e9e..260a760 100644
--- a/driv
fails then we'll leak the memory allocated for 'sysram'
with vmalloc().
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/cirrus/cirrus_fbdev.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/cirrus/cirrus_fbdev.c
b/drivers/gpu/drm/cirrus/cirru
If the allocation of 'buf' succeeds but the allocation of 'msgs' fails
we'll return false and leak 'buf' when it goes out of scope.
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/i915/intel_sdvo.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions
First we allocate memory for 'sysram' with vmalloc() and subsequently
we allocate for 'info' with framebuffer_alloc(). If the second
allocation fails we return -ENOMEM, but neglect to vfree() the memory
we previously allocated for 'sysram', thus leaking i
On Fri, 22 Jun 2012, devendra.aaru wrote:
> On Fri, Jun 22, 2012 at 3:43 AM, Jesper Juhl wrote:
> > First we allocate memory for 'sysram' with vmalloc() and subsequently
> > we allocate for 'info' with framebuffer_alloc(). If the second
> > allocatio
If we ever hit the default case in the switch statement we'll return
from the function without freeing the memory we just allocated to
'intel_plane' (but that has not been used).
This patch gets rid of the leak by freeing the memory just before we
return.
Signed-off-by: Jesper Juh
Remove redundant NULL checks before kfree() in
drivers/gpu/drm/nouveau/nvc0_graph.c
Signed-off-by: Jesper Juhl
---
drivers/gpu/drm/nouveau/nvc0_graph.c |9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/nvc0_graph.c
b/drivers/gpu/drm/nouveau
51 matches
Mail list logo