diff options
author | Bin Meng | 2023-08-03 17:32:41 +0800 |
---|---|---|
committer | Anatolij Gustschin | 2023-08-13 23:08:15 +0200 |
commit | 01c76f1a64ba8cb3da9b26be481e289ee16960f0 (patch) | |
tree | be69afccfff44910596b7d9685ce4af1fdd6bda0 /drivers | |
parent | a5899cc69a99379f01e8e2f9f98e0e09b24f1656 (diff) |
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: b828ed7d7929 ("console: Allow measuring the bounding box of text")
Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 05f93047809..b5b3b662590 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -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; |