From: Wei Yongjun Date: Fri, 7 Sep 2012 06:55:32 +0000 (+0800) Subject: tcm_fc: move the dereference below the NULL test X-Git-Tag: upstream/snapshot3+hdmi~6481^2~25 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7875f179085608c659b676be74d33a2e515d8f43;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git tcm_fc: move the dereference below the NULL test The dereference should be moved below the NULL test. spatch with a semantic match is used to found this. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c index d051102..b6fd4cf 100644 --- a/drivers/target/tcm_fc/tfc_io.c +++ b/drivers/target/tcm_fc/tfc_io.c @@ -327,11 +327,12 @@ drop: */ void ft_invl_hw_context(struct ft_cmd *cmd) { - struct fc_seq *seq = cmd->seq; + struct fc_seq *seq; struct fc_exch *ep = NULL; struct fc_lport *lport = NULL; BUG_ON(!cmd); + seq = cmd->seq; /* Cleanup the DDP context in HW if DDP was setup */ if (cmd->was_ddp_setup && seq) {