Suzuki K Poulose ec48a1d981 coresight: Fix NULL pointer dereference in _coresight_build_path
_coresight_build_path assumes that all the connections of a csdev
has the child_dev initialised. This may not be true if the particular
component is not supported by the kernel config(e.g TPIU) but is
present in the DT. In which case, building a path can cause a crash like this :

  Unable to handle kernel NULL pointer dereference at virtual address 00000010
  pgd = ffffffc9750dd000
  [00000010] *pgd=00000009f5e90003, *pud=00000009f5e90003, *pmd=0000000000000000
  Internal error: Oops: 96000006 [#1] PREEMPT SMP
  Modules linked in:
  CPU: 4 PID: 1348 Comm: bash Not tainted 4.6.0-next-20160517 #1646
  Hardware name: ARM Juno development board (r0) (DT)
  task: ffffffc97517a280 ti: ffffffc9762c4000 task.ti: ffffffc9762c4000
  PC is at _coresight_build_path+0x18/0xe4
  LR is at _coresight_build_path+0xc0/0xe4
  pc : [<ffffff80083d5130>] lr : [<ffffff80083d51d8>] pstate: 20000145
  sp : ffffffc9762c7ba0

  [<ffffff80083d5130>] _coresight_build_path+0x18/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d51d8>] _coresight_build_path+0xc0/0xe4
  [<ffffff80083d5cdc>] coresight_build_path+0x40/0x68
  [<ffffff80083d5e14>] coresight_enable+0x74/0x1bc
  [<ffffff80083d60a0>] enable_source_store+0x3c/0x6c
  [<ffffff800830b17c>] dev_attr_store+0x18/0x28
  [<ffffff80081ca9c4>] sysfs_kf_write+0x40/0x50
  [<ffffff80081c9e38>] kernfs_fop_write+0x140/0x1cc
  [<ffffff8008163ec8>] __vfs_write+0x28/0x110
  [<ffffff8008164bf0>] vfs_write+0xa0/0x174
  [<ffffff8008165d18>] SyS_write+0x44/0xa0
  [<ffffff8008084e70>] el0_svc_naked+0x24/0x28

Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-16 00:13:06 -07:00
..
2016-05-27 15:26:11 -07:00
2016-05-31 11:52:59 -07:00
2016-05-24 11:00:20 -07:00
2016-05-26 19:34:26 -07:00
2016-05-27 15:26:11 -07:00
2016-05-19 11:27:09 -07:00
2016-06-03 22:34:18 +02:00
2016-05-03 11:22:10 +09:00
2016-05-27 15:26:11 -07:00
2016-05-31 22:17:05 +05:30
2016-05-20 21:26:15 -07:00
2016-05-28 17:37:42 +02:00
2016-05-27 15:26:11 -07:00
2016-05-25 10:40:15 -07:00
2016-05-24 11:00:20 -07:00
2016-05-18 16:38:59 -07:00
2016-05-27 15:26:11 -07:00
2016-05-26 19:34:26 -07:00
2016-05-27 15:26:11 -07:00
2016-05-24 11:00:20 -07:00
2016-05-20 21:20:31 -07:00
2016-05-20 21:12:25 -07:00
2016-05-20 21:26:15 -07:00
2016-05-29 22:32:27 -07:00
2016-05-25 10:40:15 -07:00
2016-05-26 19:34:26 -07:00
2016-05-20 18:33:37 -07:00
2016-05-29 13:28:39 -07:00
2016-05-28 12:23:12 -07:00
2016-05-31 21:25:52 -06:00
2016-05-10 01:19:26 -07:00
2016-05-31 08:20:43 +03:00
2016-05-23 11:18:01 -07:00