Skip to content

Commit

Permalink
tcm_fc: move the dereference below the NULL test
Browse files Browse the repository at this point in the history
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 <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Wei Yongjun authored and Nicholas Bellinger committed Sep 18, 2012
1 parent d81cb44 commit 7875f17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/target/tcm_fc/tfc_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,11 +327,12 @@ void ft_recv_write_data(struct ft_cmd *cmd, struct fc_frame *fp)
*/
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) {
Expand Down

0 comments on commit 7875f17

Please sign in to comment.