wimax/i2400m: don't write to memory allocated by request_firmware()
authorCindy H Kao <evans@localhost.localdomain>
Wed, 19 Aug 2009 02:27:18 +0000 (19:27 -0700)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 19 Oct 2009 06:55:47 +0000 (15:55 +0900)
In kernel 2.6.31, the firmware requested to ram could be marked
with read only attribute, and we can't write any thing directly
to the memory when setting up the last JUMP brh cmd.

Changed so that the scratch buffer is used.

Signed-off-by: Cindy H Kao <cindy.h.kao@intel.com>
Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/fw.c

index 0018cdbd01568dbf453e4612575f6d1c8763de0e..92d4d605dc2d9bb02c09100677cacc06434ee226 100644 (file)
@@ -533,6 +533,10 @@ int i2400m_dnload_finalize(struct i2400m *i2400m,
                struct i2400m_bootrom_header jump_ack;
                d_printf(1, dev, "unsecure boot, jumping to 0x%08x\n",
                        le32_to_cpu(cmd->target_addr));
+               cmd_buf = i2400m->bm_cmd_buf;
+               memcpy(&cmd_buf->cmd, cmd, sizeof(*cmd));
+               cmd = &cmd_buf->cmd;
+               /* now cmd points to the actual bootrom_header in cmd_buf */
                i2400m_brh_set_opcode(cmd, I2400M_BRH_JUMP);
                cmd->data_size = 0;
                ret = i2400m_bm_cmd(i2400m, cmd, sizeof(*cmd),