mirror of
https://xff.cz/git/u-boot/
synced 2025-10-08 03:35:37 +02:00
video: vidconsole: Fix null dereference of ops->measure
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: b828ed7d79
("console: Allow measuring the bounding box of text")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Anatolij Gustschin
parent
a5899cc69a
commit
01c76f1a64
@@ -603,7 +603,7 @@ int vidconsole_measure(struct udevice *dev, const char *name, uint size,
|
||||
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;
|
||||
|
Reference in New Issue
Block a user