|
@@ -1797,11 +1797,25 @@ int remove_conflicting_framebuffers(struct apertures_struct *a,
|
|
const char *name, bool primary)
|
|
const char *name, bool primary)
|
|
{
|
|
{
|
|
int ret;
|
|
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);
|
|
mutex_lock(®istration_lock);
|
|
ret = do_remove_conflicting_framebuffers(a, name, primary);
|
|
ret = do_remove_conflicting_framebuffers(a, name, primary);
|
|
mutex_unlock(®istration_lock);
|
|
mutex_unlock(®istration_lock);
|
|
|
|
|
|
|
|
+ if (do_free)
|
|
|
|
+ kfree(a);
|
|
|
|
+
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
EXPORT_SYMBOL(remove_conflicting_framebuffers);
|
|
EXPORT_SYMBOL(remove_conflicting_framebuffers);
|