]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
lib: logic_pio: Avoid possible overlap for unregistering regions
authorJohn Garry <john.garry@huawei.com>
Tue, 30 Jul 2019 13:29:53 +0000 (21:29 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Sep 2019 08:23:45 +0000 (10:23 +0200)
commit0a6e7568654317183106fcd8e4641c41d5bdf6e4
tree641f6db85a8a22d698483a892d0ac2b80edfd6d3
parent94cfb33438e03f4c9abcc41f10dcd13b32c9d349
lib: logic_pio: Avoid possible overlap for unregistering regions

commit 0a27142bd1ee259e24a0be2b0133e5ca5df8da91 upstream.

The code was originally written to not support unregistering logical PIO
regions.

To accommodate supporting unregistering logical PIO regions, subtly modify
LOGIC_PIO_CPU_MMIO region registration code, such that the "end" of the
registered regions is the "end" of the last region, and not the sum of
the sizes of all the registered regions.

Cc: stable@vger.kernel.org
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
lib/logic_pio.c