Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 940da353 authored by Wei Yongjun's avatar Wei Yongjun Committed by Linus Torvalds
Browse files

memstick: 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: default avatarWei Yongjun <yongjun_wei@trendmicro.com.cn>
Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 507063b2
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -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) */
/* Executes one TPC (data is read/written from small or large fifo) */
static void r592_execute_tpc(struct r592_device *dev)
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;
	int len, error;
	u32 status, reg;
	u32 status, reg;


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


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