projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27d8d44
)
MIPS: VPE: Exit vpe_release() early if vpe_run() isn't defined
author
Bjorn Helgaas
<
[email protected]
>
Sun, 12 Jul 2015 23:11:12 +0000
(18:11 -0500)
committer
Ralf Baechle
<
[email protected]
>
Wed, 26 Aug 2015 13:23:39 +0000
(15:23 +0200)
vpe_run() is a weak symbol. If there's no definition of it, its value is
zero.
If vpe_run is zero, return failure early. We're going to fail anyway, so
there's no point in getting a VPE and attempting to load it.
Signed-off-by: Bjorn Helgaas <
[email protected]
>
Cc: Andrew Bresticker <
[email protected]
>
Cc:
[email protected]
Cc: James Hogan <
[email protected]
>
Cc:
[email protected]
Patchwork: https://patchwork.linux-mips.org/patch/10683/
Signed-off-by: Ralf Baechle <
[email protected]
>
arch/mips/kernel/vpe.c
patch
|
blob
|
history
diff --git
a/arch/mips/kernel/vpe.c
b/arch/mips/kernel/vpe.c
index 11da314565cc331a03ad2e5b75b834361842d831..72cae9f554609d2cb3834269b106d4cb24a4d9e4 100644
(file)
--- a/
arch/mips/kernel/vpe.c
+++ b/
arch/mips/kernel/vpe.c
@@
-821,13
+821,18
@@
static int vpe_release(struct inode *inode, struct file *filp)
Elf_Ehdr *hdr;
int ret = 0;
+ if (!vpe_run) {
+ pr_warn("VPE loader: ELF load failed.\n");
+ return -ENOEXEC;
+ }
+
v = get_vpe(aprp_cpu_index());
if (v == NULL)
return -ENODEV;
hdr = (Elf_Ehdr *) v->pbuffer;
if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) == 0) {
- if (
(vpe_elfload(v) >= 0) && vpe_run
) {
+ if (
vpe_elfload(v) >= 0
) {
vpe_run(v);
} else {
pr_warn("VPE loader: ELF load failed.\n");