OSDN Git Service

_device_unregister: check for unregistering the same device twice
authorHans de Goede <hdegoede@redhat.com>
Wed, 28 Apr 2010 17:14:36 +0000 (19:14 +0200)
committerJim Meyering <meyering@redhat.com>
Fri, 30 Apr 2010 15:39:39 +0000 (17:39 +0200)
commit4af29e02aab03cb80df7db5b09cc2eddab2249e2
tree29402ac33b0ee3e261f78e12fef4cd46f29c1c0e
parent1611f6e9c09d0168f36939e8d22f404cfd9a1f2e
_device_unregister: check for unregistering the same device twice

_device_unregister() can get called 2 times for the same device if
a libparted user explictly removes the device from the cache using
ped_device_cache_remove(), it gets called and it then becomes the
user's responsibility to free the PedDevice by calling
ped_device_destroy(). ped_device_destroy() will then call
_device_unregister() a second time with the same device, so if the
device is not found in the list, do nothing.

* libparted/device.c(_device_unregister): Check for unregistering
the same device twice.
Reported by Jan Stodola in <http://bugzilla.redhat.com/568346>.
NEWS
libparted/device.c