]> Git Repo - linux.git/commitdiff
scsi: target: cxgbit: Fix cxgbit_fw4_ack()
authorBart Van Assche <[email protected]>
Wed, 23 Oct 2019 20:21:50 +0000 (13:21 -0700)
committerMartin K. Petersen <[email protected]>
Fri, 25 Oct 2019 00:22:00 +0000 (20:22 -0400)
Use the pointer 'p' after having tested that pointer instead of before.

Fixes: 5cadafb236df ("target/cxgbit: Fix endianness annotations")
Cc: Varun Prakash <[email protected]>
Cc: Nicholas Bellinger <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reported-by: Dan Carpenter <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
drivers/target/iscsi/cxgbit/cxgbit_cm.c

index 22dd4c457d6a8eb8fa579fab49f9a5deea81e4ff..23a90c685dc65abe7fefd210fa4da0027feee2f5 100644 (file)
@@ -1829,7 +1829,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",
@@ -1838,6 +1838,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,
This page took 0.063675 seconds and 4 git commands to generate.