* [PATCH] target/cxgbit: Fix cxgbit_fw4_ack()
@ 2019-10-23 20:21 Bart Van Assche
2019-10-25 0:22 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Bart Van Assche @ 2019-10-23 20:21 UTC (permalink / raw)
To: Martin K . Petersen
Cc: Mike Christie, Christoph Hellwig, target-devel, Bart Van Assche,
Dan Carpenter, Varun Prakash, Nicholas Bellinger, stable
Use the pointer 'p' after having tested that pointer instead of before.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Varun Prakash <varun@chelsio.com>
Cc: Nicholas Bellinger <nab@linux-iscsi.org>
Cc: <stable@vger.kernel.org>
Fixes: 5cadafb236df ("target/cxgbit: Fix endianness annotations")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
drivers/target/iscsi/cxgbit/cxgbit_cm.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/target/iscsi/cxgbit/cxgbit_cm.c b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
index c70caf4ea490..a2b5c796bbc4 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_cm.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_cm.c
@@ -1831,7 +1831,7 @@ static void cxgbit_fw4_ack(struct cxgbit_sock *csk, struct sk_buff *skb)
while (credits) {
struct sk_buff *p = cxgbit_sock_peek_wr(csk);
- const u32 csum = (__force u32)p->csum;
+ u32 csum;
if (unlikely(!p)) {
pr_err("csk 0x%p,%u, cr %u,%u+%u, empty.\n",
@@ -1840,6 +1840,7 @@ static void cxgbit_fw4_ack(struct cxgbit_sock *csk, struct sk_buff *skb)
break;
}
+ csum = (__force u32)p->csum;
if (unlikely(credits < csum)) {
pr_warn("csk 0x%p,%u, cr %u,%u+%u, < %u.\n",
csk, csk->tid,
--
2.23.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-10-25 0:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-10-23 20:21 [PATCH] target/cxgbit: Fix cxgbit_fw4_ack() Bart Van Assche
2019-10-25 0:22 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox