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: Jesper
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 scope.
> >
> > Signed-off
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 scope.
Signed-off-by: Jesper Juhl j...@chaosbits.net
I've
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(-)
note: compile tested only due
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 j...@chaosbits.net
---
drivers/gpu/drm/i915/intel_sdvo.c | 11 +--
1 file changed, 5 insertions(+), 6 deletions(-)
note
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/cirrus_fbdev.c
index
' 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/drivers/gpu/drm/ast
' if the framebuffer_alloc()
call fails and the variable goes out of scope.
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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
fails then we'll leak the memory allocated for 'sysram'
with vmalloc().
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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
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 Juhl j
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
> > allocation fails we return
On Fri, 22 Jun 2012, devendra.aaru wrote:
On Fri, Jun 22, 2012 at 3:43 AM, Jesper Juhl j...@chaosbits.net wrote:
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
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 it.
Signed-off-by: Jesper Juhl
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 it.
Signed-off-by: Jesper Juhl j
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/gpu/drm/gma500
drivers/gpu/drm/gma500/mdfld_dsi_output.h does not need to
'#include linux/version.h' - so don't.
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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
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/radeon
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 j...@chaosbits.net
---
drivers/gpu/drm/radeon/radeon_cp.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm
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
Remove redundant NULL checks before kfree() in
drivers/gpu/drm/nouveau/nvc0_graph.c
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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
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
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
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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
return statement needs just one semi-colon
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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
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 +-
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 standby2...@gmail.com
Reviewed-by: Jesper Juhl j...@chaosbits.net
---
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c |2 +-
1 files changed
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_encoder', but w
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_encoder', but we then proceed to use that free'd
ned-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/gma500/psb_intel_lvds.c
index a25e4ca..0a43758 100644
--- a/drivers/gpu/drm/gma
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 'psb_intel_encoder->dev_p
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
---
drivers/gpu
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 minimal solution. If consolidating all exits from the
funct
it is not
needed.
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
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 minimal solution. If consolidating all exits from
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 j...@chaosbits.net
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 'psb_intel_encoder-dev_priv = lvds_priv
-by: Jesper Juhl j...@chaosbits.net
---
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/gma500/psb_intel_lvds.c
index a25e4ca..0a43758 100644
--- a/drivers/gpu/drm
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
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
> &g
ich
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.
diff --git a/drivers/gpu/d
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(+), 1 deletions
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 j...@chaosbits.net
---
drivers/gpu/drm/nouveau/nva3_pm.c |4 +++-
1 files changed, 3 insertions(+), 1
created the error which is impossible if the error messages are
100% identical.
Signed-off-by: Jesper Juhl j...@chaosbits.net
---
drivers/gpu/drm/nouveau/nv20_graph.c |4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
Don't have the hardware, so compile tested only.
diff --git a/drivers
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 allocated to 'pgraph'.
This patch should fix
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/nouveau/nv20_graph.c:nv20_graph_create() we'll leak the
memory
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.
diff --git
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 j...@chaosbits.net
---
i915_gem.c |4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
Untested patch - user
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 j...@chaosbits.net
---
mkregtable.c |5 -
1 file
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 insertions
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 file
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 j...@chaosbits.net
---
drm_sman.c
50 matches
Mail list logo