Skip to content

Commit 7e7f656

Browse files
committed
Merge tag 'ipe-pr-20241119' of git://git.kernel.org/pub/scm/linux/kernel/git/wufan/ipe
Pull IPE update from Fan Wu: "One commit from Colin Ian King, which removes unnecessary error handling code in the IPE boot policy generation helper program" * tag 'ipe-pr-20241119' of git://git.kernel.org/pub/scm/linux/kernel/git/wufan/ipe: scripts: ipe: polgen: remove redundant close and error exit path
2 parents df66aea + 9080d11 commit 7e7f656

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

scripts/ipe/polgen/polgen.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,12 @@ static int policy_to_buffer(const char *pathname, char **buffer, size_t *size)
6161

6262
static int write_boot_policy(const char *pathname, const char *buf, size_t size)
6363
{
64-
int rc = 0;
6564
FILE *fd;
6665
size_t i;
6766

6867
fd = fopen(pathname, "w");
69-
if (!fd) {
70-
rc = errno;
71-
goto err;
72-
}
68+
if (!fd)
69+
return errno;
7370

7471
fprintf(fd, "/* This file is automatically generated.");
7572
fprintf(fd, " Do not edit. */\n");
@@ -113,11 +110,6 @@ static int write_boot_policy(const char *pathname, const char *buf, size_t size)
113110
fclose(fd);
114111

115112
return 0;
116-
117-
err:
118-
if (fd)
119-
fclose(fd);
120-
return rc;
121113
}
122114

123115
int main(int argc, const char *const argv[])

0 commit comments

Comments
 (0)