diff options
author | Alexander Shishkin <alexander.shishkin@linux.intel.com> | 2019-03-01 11:09:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-03-01 11:20:38 +0300 |
commit | 91d3f8a629849968dc91d6ce54f2d46abf4feb7f (patch) | |
tree | efaddfd4503ff8116b88361b1bf290e1869c97e0 /drivers | |
parent | 8c8448792a4940207bc16b84df7580729aa3e247 (diff) | |
download | linux-91d3f8a629849968dc91d6ce54f2d46abf4feb7f.tar.xz |
intel_th: gth: Fix an off-by-one in output unassigning
Commit 9ed3f22223c3 ("intel_th: Don't reference unassigned outputs")
fixes a NULL dereference for all masters except the last one ("256+"),
which keeps the stale pointer after the output driver had been unassigned.
Fix the off-by-one.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: 9ed3f22223c3 ("intel_th: Don't reference unassigned outputs")
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwtracing/intel_th/gth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwtracing/intel_th/gth.c b/drivers/hwtracing/intel_th/gth.c index cc287cf6eb29..edc52d75e6bd 100644 --- a/drivers/hwtracing/intel_th/gth.c +++ b/drivers/hwtracing/intel_th/gth.c @@ -616,7 +616,7 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev, othdev->output.port = -1; othdev->output.active = false; gth->output[port].output = NULL; - for (master = 0; master < TH_CONFIGURABLE_MASTERS; master++) + for (master = 0; master <= TH_CONFIGURABLE_MASTERS; master++) if (gth->master[master] == port) gth->master[master] = -1; spin_unlock(>h->gth_lock); |