target: fix NULL pointer dereference bug alloc_page() fails to get memory
authorYi Zou <yi.zou@intel.com>
Tue, 14 Aug 2012 23:06:43 +0000 (16:06 -0700)
committerNicholas Bellinger <nab@linux-iscsi.org>
Fri, 17 Aug 2012 00:33:46 +0000 (17:33 -0700)
commitd0e27c88d795fb9647153063ec48051fd84e1731
treec8b27735e4104bae438aa481d36e91eeb6ee5816
parent1fa8f4504130adc34a071a29170f570102136835
target: fix NULL pointer dereference bug alloc_page() fails to get memory

I am hitting this bug when the target is low in memory that fails the
alloc_page() for the newly submitted command. This is a sort of off-by-one
bug causing NULL pointer dereference in __free_page() since 'i' here is
really the counter of total pages that have been successfully allocated here.

Signed-off-by: Yi Zou <yi.zou@intel.com>
Cc: Andy Grover <agrover@redhat.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: Open-FCoE.org <devel@open-fcoe.org>
Cc: stable@vger.kernel.org
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/target_core_transport.c