mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 18:09:56 +00:00
intel_th: gth: Fix an off-by-one in output unassigning
[ Upstream commit91d3f8a629] Commit9ed3f22223("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:9ed3f22223("intel_th: Don't reference unassigned outputs") Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0ccd993390
commit
92d4af2766
@@ -616,7 +616,7 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev,
|
|||||||
othdev->output.port = -1;
|
othdev->output.port = -1;
|
||||||
othdev->output.active = false;
|
othdev->output.active = false;
|
||||||
gth->output[port].output = NULL;
|
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)
|
if (gth->master[master] == port)
|
||||||
gth->master[master] = -1;
|
gth->master[master] = -1;
|
||||||
spin_unlock(>h->gth_lock);
|
spin_unlock(>h->gth_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user