mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Grant Wilson <gww@btinternet.com>
Cc: linux-kernel@vger.kernel.org, Antonino Daplas <adaplas@pol.net>
Subject: Re: 2.6.14-rc1: oops during boot
Date: Wed, 14 Sep 2005 05:17:29 +0800	[thread overview]
Message-ID: <432741E9.2090401@gmail.com> (raw)
In-Reply-To: <1126643143.5170.11.camel@tlg.swandive.local>

Grant Wilson wrote:
> 2.6.14-rc1 oops on boot as a result of the patch "nvidiafb: Fallback to
> firmware EDID".
> 
> This is because the call to fb_firmware_edid added by the patch may
> return NULL but this is not checked before trying to memcpy using this
> pointer resulting in the following oops:
> 

Thanks.  Try this patch.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
---

diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
--- a/drivers/video/nvidia/nv_i2c.c
+++ b/drivers/video/nvidia/nv_i2c.c
@@ -209,10 +209,13 @@ int nvidia_probe_i2c_connector(struct fb
 
 	if (!edid && conn == 1) {
 		/* try to get from firmware */
-		edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
-		if (edid)
-			memcpy(edid, fb_firmware_edid(info->device),
-			       EDID_LENGTH);
+		const u8 *e = fb_firmware_edid(info->device);
+		
+		if (e != NULL) {
+			edid = kmalloc(EDID_LENGTH, GFP_KERNEL);
+			if (edid)
+				memcpy(edid, e, EDID_LENGTH);
+		}
 	}
 
 	if (out_edid)

  reply	other threads:[~2005-09-13 21:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-13 20:25 Grant Wilson
2005-09-13 21:17 ` Antonino A. Daplas [this message]
2005-09-13 21:43   ` Grant Wilson

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=432741E9.2090401@gmail.com \
    --to=adaplas@gmail.com \
    --cc=adaplas@pol.net \
    --cc=gww@btinternet.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®