diff mbox

drm/i915: free intel_fb

Message ID 1471964444-24460-1-git-send-email-matthew.auld@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Matthew Auld Aug. 23, 2016, 3 p.m. UTC
We need to free the allocated intel_fb in the error path, not
intel_fb->base. Otherwise we risk calling kfree with a non-kmalloc'd
address, which is bound to give us grief at some point.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chris Wilson Aug. 23, 2016, 3:16 p.m. UTC | #1
On Tue, Aug 23, 2016 at 04:00:44PM +0100, Matthew Auld wrote:
> We need to free the allocated intel_fb in the error path, not
> intel_fb->base. Otherwise we risk calling kfree with a non-kmalloc'd
> address, which is bound to give us grief at some point.
> 
> Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Matthew Auld Aug. 24, 2016, 10:06 a.m. UTC | #2
On 23 August 2016 at 20:21, Patchwork <patchwork@emeril.freedesktop.org> wrote:
> == Series Details ==
>
> Series: drm/i915: free intel_fb
> URL   : https://patchwork.freedesktop.org/series/11477/
> State : failure
>
> == Summary ==
>
> Series 11477v1 drm/i915: free intel_fb
> http://patchwork.freedesktop.org/api/1.0/series/11477/revisions/1/mbox/
>
> Test gem_exec_suspend:
>         Subgroup basic-s3:
>                 incomplete -> DMESG-WARN (fi-hsw-4770k)
Created bug report https://bugs.freedesktop.org/show_bug.cgi?id=97465

> Test kms_cursor_legacy:
>         Subgroup basic-cursor-vs-flip-legacy:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-cursor-vs-flip-varying-size:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-flip-vs-cursor-legacy:
>                 fail       -> PASS       (fi-bdw-5557u)
>         Subgroup basic-flip-vs-cursor-varying-size:
>                 fail       -> PASS       (fi-bsw-n3050)
https://bugs.freedesktop.org/show_bug.cgi?id=97188

> Test prime_busy:
>         Subgroup basic-after-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-before-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-wait-after-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-wait-before-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
Created bug report https://bugs.freedesktop.org/show_bug.cgi?id=97463

> Test prime_vgem:
>         Subgroup basic-busy-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-gtt:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-sync-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
>         Subgroup basic-wait-default:
>                 pass       -> FAIL       (fi-bsw-n3050)
Created bug report https://bugs.freedesktop.org/show_bug.cgi?id=97464
Joonas Lahtinen Aug. 24, 2016, 1:08 p.m. UTC | #3
Hi,

There also seems to be SUCCESS results for the series, strange.

Anyway, pushed it. Thanks for the patch and review!

Regards, Joonas

On ke, 2016-08-24 at 11:06 +0100, Matthew Auld wrote:
> On 23 August 2016 at 20:21, Patchwork  wrote:
> > 
> > == Series Details ==
> > 
> > Series: drm/i915: free intel_fb
> > URL   : https://patchwork.freedesktop.org/series/11477/
> > State : failure
> > 
> > == Summary ==
> > 
> > Series 11477v1 drm/i915: free intel_fb
> > http://patchwork.freedesktop.org/api/1.0/series/11477/revisions/1/mbox/
> > 
> > Test gem_exec_suspend:
> >         Subgroup basic-s3:
> >                 incomplete -> DMESG-WARN (fi-hsw-4770k)
> Created bug report https://bugs.freedesktop.org/show_bug.cgi?id=97465
> 
> > 
> > Test kms_cursor_legacy:
> >         Subgroup basic-cursor-vs-flip-legacy:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-cursor-vs-flip-varying-size:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-flip-vs-cursor-legacy:
> >                 fail       -> PASS       (fi-bdw-5557u)
> >         Subgroup basic-flip-vs-cursor-varying-size:
> >                 fail       -> PASS       (fi-bsw-n3050)
> https://bugs.freedesktop.org/show_bug.cgi?id=97188
> 
> > 
> > Test prime_busy:
> >         Subgroup basic-after-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-before-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-wait-after-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-wait-before-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> Created bug report https://bugs.freedesktop.org/show_bug.cgi?id=97463
> 
> > 
> > Test prime_vgem:
> >         Subgroup basic-busy-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-gtt:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-sync-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> >         Subgroup basic-wait-default:
> >                 pass       -> FAIL       (fi-bsw-n3050)
> Created bug report https://bugs.freedesktop.org/show_bug.cgi?id=97464
Chris Wilson Aug. 24, 2016, 1:11 p.m. UTC | #4
On Wed, Aug 24, 2016 at 04:08:29PM +0300, Joonas Lahtinen wrote:
> Hi,
> 
> There also seems to be SUCCESS results for the series, strange.

fi-bsw-n3050 was repaired and the test rerun, that seems to have done
the trick.
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a5c80cb5..79bc99d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -9798,7 +9798,7 @@  skylake_get_initial_plane_config(struct intel_crtc *crtc,
 	return;
 
 error:
-	kfree(fb);
+	kfree(intel_fb);
 }
 
 static void ironlake_get_pfit_config(struct intel_crtc *crtc,