lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87irlpgxmh.fsf@hades.wkstn.nix>
Date:	Sat, 22 Jul 2006 22:04:06 +0100
From:	Nix <nix@...eri.org.uk>
To:	Dave Airlie <airlied@...ux.ie>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gpu: Initial GPU layer addition. (03/07)

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ