mirror of
https://github.com/torvalds/linux.git
synced 2024-11-12 07:01:57 +00:00
intel_th: Fix device removal logic
Commita753bfcfdb
("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:a753bfcfdb
("intel_th: Make the switch allocate its subdevices") CC: stable@vger.kernel.org # v4.14+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
d193d1a210
commit
8801922cd9
@ -139,7 +139,8 @@ static int intel_th_remove(struct device *dev)
|
||||
th->thdev[i] = NULL;
|
||||
}
|
||||
|
||||
th->num_thdevs = lowest;
|
||||
if (lowest >= 0)
|
||||
th->num_thdevs = lowest;
|
||||
}
|
||||
|
||||
if (thdrv->attr_group)
|
||||
|
Loading…
Reference in New Issue
Block a user