All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: David Weinehall <david.weinehall@linux.intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org,
	drm-intel-fixes@lists.freedesktop.org, mroos@linux.ee
Subject: Re: [PATCH] drm/i915/dvo: Remove dangling call to drm_encoder_cleanup()
Date: Wed, 24 Aug 2016 15:20:28 +0300	[thread overview]
Message-ID: <87eg5e73zn.fsf@intel.com> (raw)
In-Reply-To: <20160823093103.vy3oytdjsl3cfebi@boom>

On Tue, 23 Aug 2016, David Weinehall <david.weinehall@linux.intel.com> wrote:
> On Tue, Aug 23, 2016 at 10:25:58AM +0100, Chris Wilson wrote:
>> If we hit the error path, we have never called drm_encoder_init() and so
>> have nothing to cleanup. Doing so hits a null dereference:
>> 
>> [   10.066261] BUG: unable to handle kernel NULL pointer dereference at 00000104
>> [   10.066273] IP: [<c16054b4>] mutex_lock+0xa/0x15
>> [   10.066287] *pde = 00000000
>> [   10.066295] Oops: 0002 [#1]
>> [   10.066302] Modules linked in: i915(+) video i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm iTCO_wdt iTCO_vendor_support ppdev evdev snd_intel8x0 snd_ac97_codec ac97_bus psmouse snd_pcm snd_timer snd pcspkr uhci_hcd ehci_pci soundcore sr_mod ehci_hcd serio_raw i2c_i801 usbcore i2c_smbus cdrom lpc_ich mfd_core rng_core e100 mii floppy parport_pc parport acpi_cpufreq button processor usb_common eeprom lm85 hwmon_vid autofs4
>> [   10.066378] CPU: 0 PID: 132 Comm: systemd-udevd Not tainted 4.8.0-rc3-00013-gef0e1ea #34
>> [   10.066389] Hardware name: MicroLink                               /D865GLC                        , BIOS BF86510A.86A.0077.P25.0508040031 08/04/2005
>> [   10.066401] task: f62db800 task.stack: f5970000
>> [   10.066409] EIP: 0060:[<c16054b4>] EFLAGS: 00010286 CPU: 0
>> [   10.066417] EIP is at mutex_lock+0xa/0x15
>> [   10.066424] EAX: 00000104 EBX: 00000104 ECX: 00000000 EDX: 80000000
>> [   10.066432] ESI: 00000000 EDI: 00000104 EBP: f5be8000 ESP: f5971b58
>> [   10.066439]  DS: 007b ES: 007b FS: 0000 GS: 00e0 SS: 0068
>> [   10.066446] CR0: 80050033 CR2: 00000104 CR3: 35945000 CR4: 000006d0
>> [   10.066453] Stack:
>> [   10.066459]  f503d740 f824dddf 00000000 f61170c0 f61170c0 f82371ae f850f40e 00000001
>> [   10.066476]  f61170c0 f5971bcc f5be8000 f9c2d401 00000001 f8236fcc 00000001 00000000
>> [   10.066491]  f5144014 f5be8104 00000008 f9c5267c 00000007 f61170c0 f5144400 f9c4ff00
>> [   10.066507] Call Trace:
>> [   10.066526]  [<f824dddf>] ? drm_modeset_lock_all+0x27/0xb3 [drm]
>> [   10.066545]  [<f82371ae>] ? drm_encoder_cleanup+0x1a/0x132 [drm]
>> [   10.066559]  [<f850f40e>] ? drm_atomic_helper_connector_reset+0x3f/0x5c [drm_kms_helper]
>> [   10.066644]  [<f9c2d401>] ? intel_dvo_init+0x569/0x788 [i915]
>> [   10.066663]  [<f8236fcc>] ? drm_encoder_init+0x43/0x20b [drm]
>> [   10.066734]  [<f9bf1fce>] ? intel_modeset_init+0x1436/0x17dd [i915]
>> [   10.066791]  [<f9b37636>] ? i915_driver_load+0x85a/0x15d3 [i915]
>> [   10.066846]  [<f9b3603d>] ? i915_driver_open+0x5/0x5 [i915]
>> [   10.066857]  [<c14af4d0>] ? firmware_map_add_entry.part.2+0xc/0xc
>> [   10.066868]  [<c1343daf>] ? pci_device_probe+0x8e/0x11c
>> [   10.066878]  [<c140cec8>] ? driver_probe_device+0x1db/0x62e
>> [   10.066888]  [<c120c010>] ? kernfs_new_node+0x29/0x9c
>> [   10.066897]  [<c13438e0>] ? pci_match_device+0xd9/0x161
>> [   10.066905]  [<c120c48b>] ? kernfs_create_dir_ns+0x42/0x88
>> [   10.066914]  [<c140d401>] ? __driver_attach+0xe6/0x11b
>> [   10.066924]  [<c1303b13>] ? kobject_add_internal+0x1bb/0x44f
>> [   10.066933]  [<c140d31b>] ? driver_probe_device+0x62e/0x62e
>> [   10.066941]  [<c140a2d2>] ? bus_for_each_dev+0x46/0x7f
>> [   10.066950]  [<c140c502>] ? driver_attach+0x1a/0x34
>> [   10.066958]  [<c140d31b>] ? driver_probe_device+0x62e/0x62e
>> [   10.066966]  [<c140b758>] ? bus_add_driver+0x217/0x32a
>> [   10.066975]  [<f8403000>] ? 0xf8403000
>> [   10.066982]  [<c140de27>] ? driver_register+0x5f/0x108
>> [   10.066991]  [<c1000493>] ? do_one_initcall+0x49/0x1f6
>> [   10.067000]  [<c1082299>] ? pick_next_task_fair+0x14b/0x2a3
>> [   10.067008]  [<c1603c8d>] ? __schedule+0x15c/0x4fe
>> [   10.067016]  [<c1604104>] ? preempt_schedule_common+0x19/0x3c
>> [   10.067027]  [<c11051de>] ? do_init_module+0x17/0x230
>> [   10.067035]  [<c1604139>] ? _cond_resched+0x12/0x1a
>> [   10.067044]  [<c116f9aa>] ? kmem_cache_alloc+0x8f/0x11f
>> [   10.067052]  [<c11051de>] ? do_init_module+0x17/0x230
>> [   10.067060]  [<c11703dd>] ? kfree+0x137/0x203
>> [   10.067068]  [<c110523d>] ? do_init_module+0x76/0x230
>> [   10.067078]  [<c10cadf3>] ? load_module+0x2a39/0x333f
>> [   10.067087]  [<c10cb8b2>] ? SyS_finit_module+0x96/0xd5
>> [   10.067096]  [<c1132231>] ? vm_mmap_pgoff+0x79/0xa0
>> [   10.067105]  [<c1001e96>] ? do_fast_syscall_32+0xb5/0x1b0
>> [   10.067114]  [<c16086a6>] ? sysenter_past_esp+0x47/0x75
>> [   10.067121] Code: c8 f7 76 c1 e8 8e cc d2 ff e9 45 fe ff ff 66 90 66 90 66 90 66 90 90 ff 00 7f 05 e8 4e 0c 00 00 c3 53 89 c3 e8 75 ec ff ff 89 d8 <ff> 08 79 05 e8 fa 0a 00 00 5b c3 53 89 c3 85 c0 74 1b 8b 03 83
>> [   10.067180] EIP: [<c16054b4>] mutex_lock+0xa/0x15 SS:ESP 0068:f5971b58
>> [   10.067190] CR2: 0000000000000104
>> [   10.067222] ---[ end trace 049f1f09da45a856 ]---
>> 
>> Reported-by: Meelis Roos <mroos@linux.ee>
>> Fixes: 580d8ed522e0 ("drm/i915: Give encoders useful names")
>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
>> Cc: drm-intel-fixes@lists.freedesktop.org
>> ---
>>  drivers/gpu/drm/i915/intel_dvo.c | 1 -
>>  1 file changed, 1 deletion(-)
>> 
>> diff --git a/drivers/gpu/drm/i915/intel_dvo.c b/drivers/gpu/drm/i915/intel_dvo.c
>> index 47bdf9dad0d3..b9e5a63a7c9e 100644
>> --- a/drivers/gpu/drm/i915/intel_dvo.c
>> +++ b/drivers/gpu/drm/i915/intel_dvo.c
>> @@ -554,7 +554,6 @@ void intel_dvo_init(struct drm_device *dev)
>>  		return;
>>  	}
>>  
>> -	drm_encoder_cleanup(&intel_encoder->base);
>>  	kfree(intel_dvo);
>>  	kfree(intel_connector);
>>  }
>
> Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>

Applied to dinq, and cherry-picked to fixes. Thanks for the patch and
review.

BR,
Jani.


> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-08-24 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-23  9:25 [PATCH] drm/i915/dvo: Remove dangling call to drm_encoder_cleanup() Chris Wilson
2016-08-23  9:31 ` David Weinehall
2016-08-24 12:20   ` Jani Nikula [this message]
2016-08-23 10:20 ` ✗ Fi.CI.BAT: failure for " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eg5e73zn.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=david.weinehall@linux.intel.com \
    --cc=drm-intel-fixes@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mroos@linux.ee \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.