add missing close() in do_protect
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
75a9c260c8
commit
b184805fcc
|
@ -117,6 +117,7 @@ static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
|
||||||
struct stat s;
|
struct stat s;
|
||||||
int prot = 1;
|
int prot = 1;
|
||||||
unsigned long start = 0, size = ~0;
|
unsigned long start = 0, size = ~0;
|
||||||
|
int ret = 0;
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
u_boot_cmd_usage(cmdtp);
|
u_boot_cmd_usage(cmdtp);
|
||||||
|
@ -149,17 +150,19 @@ static int do_protect (cmd_tbl_t *cmdtp, int argc, char *argv[])
|
||||||
if (argc == 3)
|
if (argc == 3)
|
||||||
if (parse_area_spec(argv[2], &start, &size)) {
|
if (parse_area_spec(argv[2], &start, &size)) {
|
||||||
printf("could not parse: %s\n", argv[optind]);
|
printf("could not parse: %s\n", argv[optind]);
|
||||||
return 1;
|
ret = 1;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(protect(fd, size, start, prot)) {
|
if(protect(fd, size, start, prot)) {
|
||||||
perror("protect");
|
perror("protect");
|
||||||
return 1;
|
ret = 1;
|
||||||
|
goto out;
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
close(fd);
|
close(fd);
|
||||||
|
|
||||||
return 0;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const __maybe_unused char cmd_protect_help[] =
|
static const __maybe_unused char cmd_protect_help[] =
|
||||||
|
|
Loading…
Reference in New Issue