drm/ast: Fix incorrect free on ioregs
authorSam Bobroff <sbobroff@linux.ibm.com>
Mon, 5 Nov 2018 05:57:47 +0000 (16:57 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Dec 2018 08:22:29 +0000 (09:22 +0100)
commita37acf28a9dffe97781f891e2edbad7a6b0e9795
tree98f9fa4844b5caba5e5c9870a83f369d43571d50
parent001aaa0ed76393455cd65ae5d0cc65036858c5f2
drm/ast: Fix incorrect free on ioregs

commit dc25ab067645eabd037f1a23d49a666f9e0b8c68 upstream.

If the platform has no IO space, ioregs is placed next to the already
allocated regs. In this case, it should not be separately freed.

This prevents a kernel warning from __vunmap "Trying to vfree()
nonexistent vm area" when unloading the driver.

Fixes: 0dd68309b9c5 ("drm/ast: Try to use MMIO registers when PIO isn't supported")

Signed-off-by: Sam Bobroff <sbobroff@linux.ibm.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/ast/ast_main.c