diff options
author | 2019-07-30 21:29:55 +0800 | |
---|---|---|
committer | 2019-08-13 14:54:28 +0800 | |
commit | 1b15a5632a809ab57d403fd972ca68785363b654 (patch) | |
tree | 375b953135e98f173555d13711187bf123c62cd1 /virt | |
parent | lib: logic_pio: Add logic_pio_unregister_range() (diff) | |
download | linux-1b15a5632a809ab57d403fd972ca68785363b654.tar.gz linux-1b15a5632a809ab57d403fd972ca68785363b654.tar.bz2 linux-1b15a5632a809ab57d403fd972ca68785363b654.zip |
bus: hisi_lpc: Unregister logical PIO range to avoid potential use-after-free
If, after registering a logical PIO range, the driver probe later fails,
the logical PIO range memory will be released automatically.
This causes an issue, in that the logical PIO range is not unregistered
and the released range memory may be later referenced.
Fix by unregistering the logical PIO range.
And since we now unregister the logical PIO range for probe failure, avoid
the special ordering of setting logical PIO range ops, which was the
previous (poor) attempt at a safeguard against this.
Cc: stable@vger.kernel.org
Fixes: adf38bb0b595 ("HISI LPC: Support the LPC host on Hip06/Hip07 with DT bindings")
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions