]> git.baikalelectronics.ru Git - kernel.git/commit
libfc: Fix fc_exch_recv_req() error path
authorBart Van Assche <bart.vanassche@sandisk.com>
Fri, 5 Jun 2015 21:20:46 +0000 (14:20 -0700)
committerJames Bottomley <JBottomley@Odin.com>
Wed, 12 Aug 2015 18:23:30 +0000 (11:23 -0700)
commitfec39d7f70875f2dd99a6e851b2121d9a818fcb8
tree81261d86cae0460cb67d6a085631c15c5528776d
parentc7689ee8e438188f750c2302cf7a40fec3c321a7
libfc: Fix fc_exch_recv_req() error path

Due to patch "libfc: Do not invoke the response handler after
fc_exch_done()" (commit ID b600706a) the lport_recv() call
in fc_exch_recv_req() is passed a dangling pointer. Avoid this
by moving the fc_frame_free() call from fc_invoke_resp() to its
callers. This patch fixes the following crash:

general protection fault: 0000 [#3] PREEMPT SMP
RIP: fc_lport_recv_req+0x72/0x280 [libfc]
Call Trace:
 fc_exch_recv+0x642/0xde0 [libfc]
 fcoe_percpu_receive_thread+0x46a/0x5ed [fcoe]
 kthread+0x10a/0x120
 ret_from_fork+0x42/0x70

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Vasu Dev <vasu.dev@intel.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/libfc/fc_exch.c