Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1218485 > unrolled thread
| Started by | Peter Griffin <peter.griffin@linaro.org> |
|---|---|
| First post | 2015-09-03 20:20 +0200 |
| Last post | 2015-09-03 20:20 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v5 6/6] [media] c8sectpfe: Simplify for loop in load_slim_core_fw Peter Griffin <peter.griffin@linaro.org> - 2015-09-03 20:20 +0200
| From | Peter Griffin <peter.griffin@linaro.org> |
|---|---|
| Date | 2015-09-03 20:20 +0200 |
| Subject | [PATCH v5 6/6] [media] c8sectpfe: Simplify for loop in load_slim_core_fw |
| Message-ID | <q4Hh8-2W4-25@gated-at.bofh.it> |
Signed-off-by: Peter Griffin <peter.griffin@linaro.org>
---
drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
index c691e13..ce72ffb 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-core.c
@@ -1096,7 +1096,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
Elf32_Ehdr *ehdr;
Elf32_Phdr *phdr;
u8 __iomem *dst;
- int err, i;
+ int err = 0, i;
if (!fw || !context)
return -EINVAL;
@@ -1105,7 +1105,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
phdr = (Elf32_Phdr *)(fw->data + ehdr->e_phoff);
/* go through the available ELF segments */
- for (i = 0; i < ehdr->e_phnum && !err; i++, phdr++) {
+ for (i = 0; i < ehdr->e_phnum; i++, phdr++) {
/* Only consider LOAD segments */
if (phdr->p_type != PT_LOAD)
@@ -1118,7 +1118,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
dev_err(fei->dev,
"Segment %d is outside of firmware file\n", i);
err = -EINVAL;
- break;
+ goto err;
}
/*
@@ -1146,6 +1146,7 @@ static int load_slim_core_fw(const struct firmware *fw, void *context)
}
}
+err:
release_firmware(fw);
return err;
}
--
1.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web