@@ -1779,11 +1779,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
const char *name, bool primary)
{
int ret;
+ bool do_free = false;
+
+ if (!a) {
+ a = alloc_apertures(1);
+ if (!a)
+ return -ENOMEM;
+
+ a->ranges[0].base = 0;
+ a->ranges[0].size = ~0;
+ do_free = true;
+ }
mutex_lock(®istration_lock);
ret = do_remove_conflicting_framebuffers(a, name, primary);
mutex_unlock(®istration_lock);
+ if (do_free)
+ kfree(a);
+
return ret;
}
EXPORT_SYMBOL(remove_conflicting_framebuffers);