소스 검색

UBI: fix return code in ubi_volume_read

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

Signed-off-by: Andreas Huber <andreas.huber@keymile.com>
Signed-off-by: Stefan Roese <sr@denx.de>
Andreas Huber 16 년 전
부모
커밋
0850301747
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      common/cmd_ubi.c

+ 1 - 1
common/cmd_ubi.c

@@ -327,7 +327,7 @@ static int ubi_volume_read(char *volume, char *buf, size_t size)
 	}
 	}
 	if (i == ubi->vtbl_slots) {
 	if (i == ubi->vtbl_slots) {
 		printf("%s volume not found\n", volume);
 		printf("%s volume not found\n", volume);
-		return 0;
+		return -ENODEV;
 	}
 	}
 
 
 	printf("read %i bytes from volume %d to %x(buf address)\n",
 	printf("read %i bytes from volume %d to %x(buf address)\n",