Commit 55e174df authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGPGART] add checks to agp_copy_info() before dereferencing.

Spotted by Andi Kleen with AGPless IOMMU setup.
parent 6ecb1dbc
......@@ -270,13 +270,15 @@ EXPORT_SYMBOL_GPL(agp_num_entries);
int agp_copy_info(agp_kern_info * info)
{
memset(info, 0, sizeof(agp_kern_info));
info->chipset = agp_bridge->type;
if (agp_bridge->type == NOT_SUPPORTED)
if (!agp_bridge || agp_bridge->type == NOT_SUPPORTED ||
!agp_bridge->version) {
info->chipset = NOT_SUPPORTED;
return -EIO;
}
info->version.major = agp_bridge->version->major;
info->version.minor = agp_bridge->version->minor;
info->chipset = agp_bridge->type;
info->device = agp_bridge->dev;
info->mode = agp_bridge->mode;
info->aper_base = agp_bridge->gart_bus_addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment