Skip to contentSkip to conversation

UBI: fix return code in ubi_volume_read

PATCH New Stefan Roese 1 participant 1 message May 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBI: fix return code in ubi_volume_read

From: Andreas Huber <[email protected]>

Return -ENODEV instead of 0 when trying to read from a non existing volume.

---
 common/cmd_ubi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/cmd_ubi.c +1 -1
index 02a2e55..64a7307 100644
@@ -327,7 +327,7 @@ static int ubi_volume_read(char *volume, char *buf, size_t size)
 	}
 	if (i == ubi->vtbl_slots) {
 		printf("%s volume not found\n", volume);
-		return 0;
+		return -ENODEV;
 	}
 
 	printf("read %i bytes from volume %d to %x(buf address)\n",
Signature · 1 line
1.6.2.5