Blob Blame History Raw
From: Dennis Dalessandro <dennis.dalessandro@intel.com>
Date: Mon, 29 May 2017 17:19:46 -0700
Subject: IB/hfi1: Remove subtraction of uninitialized value
Patch-mainline: v4.14-rc1
Git-commit: 52d86e72c515ebd4fb0d329470aa50698e28fb36
References: bsc#1060463 FATE#323043

In process_receive_packet the packet header field is used to calculate
the length of the packet. However this is not necessarily setup. In fact
only if the ECN prescan is enabled will the packet header be valid at
this point.

The code works as is because we do not do anything with the packet
length at this point in the packet processing. The length and header are
setup correctly in hfi1_setup_ib_header which is called by the following
sequence:

process_receive_packet()
-> rhf_receieve_function_map[]()
--> process_receive_ib()
---> hfi1_setup_9B_packet()
----> hfi1_setup_ib_header()

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/infiniband/hw/hfi1/driver.c |    1 -
 1 file changed, 1 deletion(-)

--- a/drivers/infiniband/hw/hfi1/driver.c
+++ b/drivers/infiniband/hw/hfi1/driver.c
@@ -703,7 +703,6 @@ static inline int process_rcv_packet(str
 
 	packet->etype = rhf_rcv_type(packet->rhf);
 
-	packet->hlen = (u8 *)packet->rhf_addr - (u8 *)packet->hdr;
 	/* total length */
 	packet->tlen = rhf_pkt_len(packet->rhf); /* in bytes */
 	/* retrieve eager buffer details */