]> git.baikalelectronics.ru Git - kernel.git/commit
nouveau: Fix crash when pci_ram_rom() returns a size of 0
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Mon, 2 Apr 2012 03:37:13 +0000 (13:37 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 2 Apr 2012 10:05:58 +0000 (11:05 +0100)
commit679ae16ac43ac362eeb5e721ac5a1aa5bafac5c1
tree696b8eb9fc6541f71caede709857de3f07d08f06
parenta84f83445aa8a12f5eb193000796f5bcf816f11f
nouveau: Fix crash when pci_ram_rom() returns a size of 0

From b15b244d6e6e20964bd4b85306722cb60c3c0809 Mon Sep 17 00:00:00 2001
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: Mon, 2 Apr 2012 13:28:18 +1000
Subject:

Under some circumstances, pci_map_rom() can return a valid mapping
but a size of 0 (if it cannot find an image in the header).

This causes nouveau to try to kmalloc() a 0 sized pointer and
dereference it, which crashes.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/nouveau/nouveau_bios.c