At present vidconsole_measure() tests ops->select_font before calling
ops->measure, which would result in a null dereference when the console
driver provides no ops for measure.
Fixes: b828ed7d7929 ("console: Allow measuring the bounding box of text")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
struct vidconsole_ops *ops = vidconsole_get_ops(dev);
int ret;
- if (ops->select_font) {
+ if (ops->measure) {
ret = ops->measure(dev, name, size, text, bbox);
if (ret != -ENOSYS)
return ret;