]> www.infradead.org Git - users/dwmw2/linux.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Oct 2018 23:59:18 +0000 (16:59 -0700)
commitc3b92e93b23a1b6fed026acc39a8fef715bb9e4e
tree36eeeec5e43032a47492ea995e57858b94f157e1
parent98e1a83c338e4f3377c842ee7d60a5c36a30f0b3
intel_th: Fix device removal logic

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>
drivers/hwtracing/intel_th/core.c