mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
To: barebox@lists.infradead.org
Cc: andrey.gusakov@cogentembedded.com, cphealy@gmail.com
Subject: [PATCH] video: tc358767: set num_modes=0 if no valid mode found
Date: Fri, 23 Mar 2018 20:12:23 +0300	[thread overview]
Message-ID: <1521825143-9979-1-git-send-email-andrey.gusakov@cogentembedded.com> (raw)

Since commit f986661 "video: ipu: register framebuffer,
even when no modes are found" value returned from
VPL_GET_VIDEOMODES ioctl is ignored. So set valid num_modes
in error case to avoid crash in register_framebuffer.

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
---
 drivers/video/tc358767.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/tc358767.c b/drivers/video/tc358767.c
index 5ad5cb4..d4749b1 100644
--- a/drivers/video/tc358767.c
+++ b/drivers/video/tc358767.c
@@ -1258,6 +1258,7 @@ static int tc_filter_videomodes(struct tc_data *tc, struct display_timings *timi
 	} while (1);
 
 	free(timings->modes);
+	timings->num_modes = 0;
 	timings->modes = NULL;
 
 	if (!num_modes) {
-- 
1.9.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

             reply	other threads:[~2018-03-23 17:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-23 17:12 Andrey Gusakov [this message]
2018-03-26  7:25 ` Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1521825143-9979-1-git-send-email-andrey.gusakov@cogentembedded.com \
    --to=andrey.gusakov@cogentembedded.com \
    --cc=barebox@lists.infradead.org \
    --cc=cphealy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox