Re: [PATCH] gpu: Initial GPU layer addition. (03/07)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux