From: Robert Love Date: Fri, 27 Feb 2009 18:55:34 +0000 (-0800) Subject: [SCSI] libfc: check for err when recv and state is incorrect X-Git-Tag: v2.6.29~41^2~18 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efaf5c085dd2d31757b0ff7886970dfddd8d1808;p=pandora-kernel.git [SCSI] libfc: check for err when recv and state is incorrect If we've just created an interface and the an rport is logging in we may have a request on the wire (say PRLI). If we destroy the interface, we'll go through each rport on the disc->rports list and set each rport's state to NONE. Then the lport will reset the EM. The EM reset will send a CLOSED event to the prli_resp() handler which will notice that the state != PRLI. In this case it frees the frame pointer, decrements the refcount and unlocks the rport. The problem is that there isn't a frame in this case. It's just a pointer with an embedded error code. The free causes an Oops. This patch moves the error checking to be before the state checking. Signed-off-by: Robert Love Signed-off-by: James Bottomley --- Reading git-diff-tree failed