If use -P option without -s option, the program segfaults due to
dev.mode.bo being NULL.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
[Emil Velikov: Tweak the commit message.]
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
dev->mode.fb_id = fb_id;
}
+static void clear_mode(struct device *dev)
+{
+ if (dev->mode.bo)
+ bo_destroy(dev->mode.bo);
+}
+
static void set_planes(struct device *dev, struct plane_arg *p, unsigned int count)
{
unsigned int i;
if (test_cursor)
clear_cursors(&dev);
- bo_destroy(dev.mode.bo);
+ if (count)
+ clear_mode(&dev);
}
free_resources(dev.resources);