public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] video: vidconsole: Fix null dereference of ops->measure
@ 2023-08-03  9:32 Bin Meng
  2023-08-04  3:02 ` Simon Glass
  2023-08-14  6:05 ` Anatolij Gustschin
  0 siblings, 2 replies; 3+ messages in thread
From: Bin Meng @ 2023-08-03  9:32 UTC (permalink / raw)
  To: Simon Glass, Anatolij Gustschin, u-boot

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>
---

 drivers/video/vidconsole-uclass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 05f9304780..b5b3b66259 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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] video: vidconsole: Fix null dereference of ops->measure
  2023-08-03  9:32 [PATCH] video: vidconsole: Fix null dereference of ops->measure Bin Meng
@ 2023-08-04  3:02 ` Simon Glass
  2023-08-14  6:05 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Glass @ 2023-08-04  3:02 UTC (permalink / raw)
  To: Bin Meng; +Cc: Anatolij Gustschin, u-boot

On Thu, 3 Aug 2023 at 03:32, Bin Meng <bmeng@tinylab.org> wrote:
>
> 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>
> ---
>
>  drivers/video/vidconsole-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Simon Glass <sjg@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] video: vidconsole: Fix null dereference of ops->measure
  2023-08-03  9:32 [PATCH] video: vidconsole: Fix null dereference of ops->measure Bin Meng
  2023-08-04  3:02 ` Simon Glass
@ 2023-08-14  6:05 ` Anatolij Gustschin
  1 sibling, 0 replies; 3+ messages in thread
From: Anatolij Gustschin @ 2023-08-14  6:05 UTC (permalink / raw)
  To: Bin Meng; +Cc: Simon Glass, u-boot

On Thu,  3 Aug 2023 17:32:41 +0800
Bin Meng bmeng@tinylab.org wrote:

> 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>
> ---
> 
>  drivers/video/vidconsole-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

applied to u-boot-video/master, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-14  6:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03  9:32 [PATCH] video: vidconsole: Fix null dereference of ops->measure Bin Meng
2023-08-04  3:02 ` Simon Glass
2023-08-14  6:05 ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox