]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
intel_th: Fix device removal logic
authorAlexander Shishkin <alexander.shishkin@linux.intel.com>
Tue, 18 Sep 2018 13:10:47 +0000 (16:10 +0300)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:51:13 +0000 (19:51 -0600)
commit04619855d9ce0725bc78a02d4d5eaa7f8c093b2a
treeffc060e8aade0bc67e72b9511ed5c8116fa065c9
parentd01d92cf69756d7260bcdd8f9b8dbc1c57a07028
intel_th: Fix device removal logic

BugLink: https://bugs.launchpad.net/bugs/1836287
commit 8801922cd94c918e4dc3a108ecaa500c4d40583f upstream.

Commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
brings in new subdevice addition/removal logic that's broken for "host
mode": the SWITCH device has no children to begin with, which is not
handled in the code. This results in a null dereference bug later down
the path.

This patch fixes the subdevice removal code to handle host mode correctly.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
CC: stable@vger.kernel.org # v4.14+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/hwtracing/intel_th/core.c