mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
scsi: target: cxgbit: Fix cxgbit_fw4_ack()
commitfc5b220b2dupstream. Use the pointer 'p' after having tested that pointer instead of before. Fixes:5cadafb236("target/cxgbit: Fix endianness annotations") Cc: Varun Prakash <varun@chelsio.com> Cc: Nicholas Bellinger <nab@linux-iscsi.org> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20191023202150.22173-1-bvanassche@acm.org Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
03b5e0b410
commit
5c0dba1323
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user