]> git.baikalelectronics.ru Git - kernel.git/commit
wimax/i2400m: be smarter about copying command buffer to bm_cmd_buf
authorInaky Perez-Gonzalez <inaky@linux.intel.com>
Tue, 1 Sep 2009 00:15:49 +0000 (17:15 -0700)
committerInaky Perez-Gonzalez <inaky@linux.intel.com>
Mon, 19 Oct 2009 06:55:46 +0000 (15:55 +0900)
commit49a187d8fe4d2116431e3b40606f0c60828b4569
tree03f0f2cc77eb0335073c64883c5fd56217219713
parent45c59571dfe556380525a112478e3292f27d7b69
wimax/i2400m: be smarter about copying command buffer to bm_cmd_buf

Because some underlying bus APIs (like USB) don't like data buffers in
the stack or vmalloced areas, the i2400m driver provides a scratch
buffer (i2400m->bm_cmd_buf) for said low-level drivers to copy command
data to before passing it to said API. This is only used during boot
mode.

However, at some the code was copying the buffer even when the command
was already specified in said buffer. This is ok, but it needs to be
more careful. As thus, change so that:

(a) the copy happens only if command buffer is not the scratch buffer

(b) use memmove() in case there is overlapping

Signed-off-by: Inaky Perez-Gonzalez <inaky@linux.intel.com>
drivers/net/wimax/i2400m/fw.c
drivers/net/wimax/i2400m/sdio-fw.c
drivers/net/wimax/i2400m/usb-fw.c