On Tue, Jun 18, 2019 at 2:13 AM Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> wrote: > > mmu_ops->unmap() will fail when called on a BO that has not been > previously mapped, and the error path in panfrost_ioctl_create_bo() > can call drm_gem_object_put_unlocked() (which in turn calls > panfrost_mmu_unmap()) on a BO that has not been mapped yet. > > Keep track of the mapped/unmapped state to avoid such issues. > > Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver") > Cc: <stable@xxxxxxxxxxxxxxx> > Signed-off-by: Boris Brezillon <boris.brezillon@xxxxxxxxxxxxx> > --- > Changes in v2: > * Check is_mapped val in the caller and add WARN_ON() in the mmu code > (suggested by Tomeu) > --- > drivers/gpu/drm/panfrost/panfrost_gem.c | 3 ++- > drivers/gpu/drm/panfrost/panfrost_gem.h | 1 + > drivers/gpu/drm/panfrost/panfrost_mmu.c | 8 ++++++++ > 3 files changed, 11 insertions(+), 1 deletion(-) Applied. Rob _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel