1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

lvmetad: add missing dev_close in error path

Fixes missing dev_close() in dev_read error path
introduced in commit
a368698672
3e5bec37e9

(in-release fix)
This commit is contained in:
Zdenek Kabelac 2014-03-25 14:53:06 +01:00
parent ce78cb58eb
commit 65bbfdf74d

View File

@ -321,8 +321,10 @@ static int _raw_read_mda_header(struct mda_header *mdah, struct device_area *dev
if (!dev_open_readonly(dev_area->dev))
return_0;
if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah))
if (!dev_read(dev_area->dev, dev_area->start, MDA_HEADER_SIZE, mdah)) {
(void) dev_close(dev_area->dev);
return_0;
}
if (!dev_close(dev_area->dev))
return_0;