From: Yuval Mintz Date: Sun, 20 Oct 2013 14:51:27 +0000 (+0200) Subject: bnx2x: Prevent an illegal pointer dereference during panic X-Git-Tag: v3.12-rc7~20^2~8^2~7 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1a6974b2c78755ae55d7be738866eb8d57c3ed45;p=pandora-kernel.git bnx2x: Prevent an illegal pointer dereference during panic During a panic, the driver tries to print the Management FW buffer of recent commands. To do so, the driver reads the address of that buffer from a known address. If the buffer is unavailable (e.g., PCI reads don't work, MCP is failing, etc.), the driver will try to access the address it has read, possibly causing a kernel panic. This check 'sanitizes' the access, validating the read value is indeed a valid address inside the management FW's buffers. The patch also removes a read outside the scope of the buffer, which resulted in some unrelated chraracters appearing in the log. Signed-off-by: Yuval Mintz Signed-off-by: Dmitry Kravkov Signed-off-by: Eilon Greenstein Signed-off-by: David S. Miller --- Reading git-diff-tree failed