summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-11-20 14:51:08 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2024-11-20 14:51:08 -0800
commit7e7f65647e5216b667d7d98a74446a80a9adcfc0 (patch)
treecb932c9a1c41db8f2f98c23e4fc438dabd1ec104
parentdf66aeadd8f8445a1a73c39f5ec62c61c89f7e9a (diff)
parent9080d11a6c5c1fbf27127afdef84d8dcd65b91ff (diff)
downloadlwn-7e7f65647e5216b667d7d98a74446a80a9adcfc0.tar.gz
lwn-7e7f65647e5216b667d7d98a74446a80a9adcfc0.zip
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
-rw-r--r--scripts/ipe/polgen/polgen.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/scripts/ipe/polgen/polgen.c b/scripts/ipe/polgen/polgen.c
index c6283b3ff006..01134cf895d0 100644
--- a/scripts/ipe/polgen/polgen.c
+++ b/scripts/ipe/polgen/polgen.c
@@ -61,15 +61,12 @@ out:
static int write_boot_policy(const char *pathname, const char *buf, size_t size)
{
- int rc = 0;
FILE *fd;
size_t i;
fd = fopen(pathname, "w");
- if (!fd) {
- rc = errno;
- goto err;
- }
+ if (!fd)
+ return errno;
fprintf(fd, "/* This file is automatically generated.");
fprintf(fd, " Do not edit. */\n");
@@ -113,11 +110,6 @@ static int write_boot_policy(const char *pathname, const char *buf, size_t size)
fclose(fd);
return 0;
-
-err:
- if (fd)
- fclose(fd);
- return rc;
}
int main(int argc, const char *const argv[])