Fix two issues in NetBSD implementation of igp_read_bios_from_vram():
* Allocate the correct buffer for the VGA BIOS image. * Abort if buffer allocation failed, not if buffer allocation succeeded. Not directly tested, but I can't imagine this makes anything worse.
This commit is contained in:
parent
1c1ffc929a
commit
20ab6e5f00
|
@ -72,7 +72,7 @@ static bool igp_read_bios_from_vram(struct radeon_device *rdev)
|
||||||
(size < 256 * 1024) ||
|
(size < 256 * 1024) ||
|
||||||
(bus_space_read_1(bst, bsh, 0) != 0x55) ||
|
(bus_space_read_1(bst, bsh, 0) != 0x55) ||
|
||||||
(bus_space_read_1(bst, bsh, 1) != 0xaa) ||
|
(bus_space_read_1(bst, bsh, 1) != 0xaa) ||
|
||||||
((rdev = kmalloc(size, GFP_KERNEL)) != NULL)) {
|
((rdev->bios = kmalloc(size, GFP_KERNEL)) == NULL)) {
|
||||||
bus_space_unmap(bst, bsh, size);
|
bus_space_unmap(bst, bsh, size);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue