Skip to content

Commit

Permalink
memstick: 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>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Wei Yongjun authored and Linus Torvalds committed Feb 28, 2013
1 parent 507063b commit 940da35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/memstick/host/r592.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static int r592_transfer_fifo_pio(struct r592_device *dev)
/* Executes one TPC (data is read/written from small or large fifo) */
static void r592_execute_tpc(struct r592_device *dev)
{
bool is_write = dev->req->tpc >= MS_TPC_SET_RW_REG_ADRS;
bool is_write;
int len, error;
u32 status, reg;

Expand All @@ -463,6 +463,7 @@ static void r592_execute_tpc(struct r592_device *dev)
return;
}

is_write = dev->req->tpc >= MS_TPC_SET_RW_REG_ADRS;
len = dev->req->long_data ?
dev->req->sg.length : dev->req->data_len;

Expand Down

0 comments on commit 940da35

Please sign in to comment.