diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/ubi/vmt.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/vmt.c b/drivers/mtd/ubi/vmt.c index 88629a320c2b..e44948de7dd9 100644 --- a/drivers/mtd/ubi/vmt.c +++ b/drivers/mtd/ubi/vmt.c | |||
@@ -70,13 +70,14 @@ static struct device_attribute attr_vol_upd_marker = | |||
70 | static ssize_t vol_attribute_show(struct device *dev, | 70 | static ssize_t vol_attribute_show(struct device *dev, |
71 | struct device_attribute *attr, char *buf) | 71 | struct device_attribute *attr, char *buf) |
72 | { | 72 | { |
73 | int ret; | 73 | int ret = -ENODEV; |
74 | |||
74 | struct ubi_volume *vol = container_of(dev, struct ubi_volume, dev); | 75 | struct ubi_volume *vol = container_of(dev, struct ubi_volume, dev); |
75 | 76 | ||
76 | spin_lock(&vol->ubi->volumes_lock); | 77 | spin_lock(&vol->ubi->volumes_lock); |
77 | if (vol->removed) { | 78 | if (vol->removed) { |
78 | spin_unlock(&vol->ubi->volumes_lock); | 79 | spin_unlock(&vol->ubi->volumes_lock); |
79 | return -ENODEV; | 80 | return ret; |
80 | } | 81 | } |
81 | if (attr == &attr_vol_reserved_ebs) | 82 | if (attr == &attr_vol_reserved_ebs) |
82 | ret = sprintf(buf, "%d\n", vol->reserved_pebs); | 83 | ret = sprintf(buf, "%d\n", vol->reserved_pebs); |