lkml.org 
[lkml]   [2006]   [Jul]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] gpu: Initial GPU layer addition. (03/07)
From
Date
Nice stuff! A couple of total nits and a check to see if I'm
understanding something.

On 22 Jul 2006, Dave Airlie noted:
> + * If the driver type matches thte device, call the bus match function.

Typo.

> + printk(KERN_ERR "%s: to many buses\n", "gpu");

Another typo.

> +/**
> + * gpu_alloc_devices
> + *
> + * Allocate and initialise the GPU sub-devices.
> + */
> +int gpu_alloc_devices(struct gpu_bus *bus)
> +{
> + struct gpu_device *dev;
> + int i;
> +
> + for (i=0; i<bus->num_subdev; i++) {
> + dev = kzalloc(sizeof(*dev), GFP_KERNEL);
> + if (!dev)
> + return -ENOMEM;
> +
> + bus = gpu_bus_get(bus);
> + if (!bus) {
> + kfree(dev);
> + return -ENOMEM;
> + }

If we fall out of either of these paths, what does the bus look like?
Does it end up with half its sub-devices on? (I don't *think* we end up
leaking dev's allocated earlier....)

> +/**
> + * gpu_unregister_devices
> + */
> +int gpu_unregister_devices(struct gpu_bus *bus)
> +{
> + int i;
> +
> + for (i = 0; i < bus->num_subdev; i++) {
> + struct gpu_device *gpu_dev = bus->devices[i];
> +
> + device_del(&gpu_dev->dev);
> +
> + kfree(gpu_dev);
> + bus->devices[i] = NULL;
> + }
> + return 0;
> +}

... because I think this would still catch them. Am I right?

--
`We're sysadmins. We deal with the inconceivable so often I can clearly
see the need to define levels of inconceivability.' --- Rik Steenwinkel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-07-22 23:07    [W:0.078 / U:18.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site