Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 295995
b: refs/heads/master
c: cf59d3e
h: refs/heads/master
i:
  295993: 44fcdfb
  295991: 6bef0b8
v: v3
  • Loading branch information
Ohad Ben-Cohen committed Feb 22, 2012
1 parent 9d12828 commit 62369de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: dd6da1c5e99a3b736b52370c504a2b8843cbfda6
refs/heads/master: cf59d3e9a715fd2b6ff96e4a3a130fceded09a64
11 changes: 11 additions & 0 deletions trunk/drivers/remoteproc/remoteproc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include <linux/elf.h>
#include <linux/virtio_ids.h>
#include <linux/virtio_ring.h>
#include <asm/byteorder.h>

#include "remoteproc_internal.h"

Expand Down Expand Up @@ -851,6 +852,16 @@ static int rproc_fw_sanity_check(struct rproc *rproc, const struct firmware *fw)

ehdr = (struct elf32_hdr *)fw->data;

/* We assume the firmware has the same endianess as the host */
# ifdef __LITTLE_ENDIAN
if (ehdr->e_ident[EI_DATA] != ELFDATA2LSB) {
# else /* BIG ENDIAN */
if (ehdr->e_ident[EI_DATA] != ELFDATA2MSB) {
# endif
dev_err(dev, "Unsupported firmware endianess\n");
return -EINVAL;
}

if (fw->size < ehdr->e_shoff + sizeof(struct elf32_shdr)) {
dev_err(dev, "Image is too small\n");
return -EINVAL;
Expand Down

0 comments on commit 62369de

Please sign in to comment.