diff options
author | Mike Marciniszyn <mike.marciniszyn@intel.com> | 2016-08-09 11:19:56 -0400 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2016-08-22 14:31:42 -0400 |
commit | 69b9f4a4233b6f9ea168c25123b9eb629739d8e5 (patch) | |
tree | 4dd7276e4742a8fba4f0b0be56b0dc9c36a73eb0 | |
parent | c867caaf8ecd5498d399558d0f11825f175c6cdd (diff) |
IB/hfi1: Validate header in set_armed_active
Validate the etype to insure that the header is correct.
Reviewed-by: Don Hiatt <don.hiatt@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
-rw-r--r-- | drivers/infiniband/hw/hfi1/driver.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/driver.c b/drivers/infiniband/hw/hfi1/driver.c index c4156870a8bb..303f10555729 100644 --- a/drivers/infiniband/hw/hfi1/driver.c +++ b/drivers/infiniband/hw/hfi1/driver.c | |||
@@ -894,8 +894,9 @@ static inline int set_armed_to_active(struct hfi1_ctxtdata *rcd, | |||
894 | struct work_struct *lsaw = &rcd->ppd->linkstate_active_work; | 894 | struct work_struct *lsaw = &rcd->ppd->linkstate_active_work; |
895 | struct hfi1_message_header *hdr = hfi1_get_msgheader(packet->rcd->dd, | 895 | struct hfi1_message_header *hdr = hfi1_get_msgheader(packet->rcd->dd, |
896 | packet->rhf_addr); | 896 | packet->rhf_addr); |
897 | u8 etype = rhf_rcv_type(packet->rhf); | ||
897 | 898 | ||
898 | if (hdr2sc(hdr, packet->rhf) != 0xf) { | 899 | if (etype == RHF_RCV_TYPE_IB && hdr2sc(hdr, packet->rhf) != 0xf) { |
899 | int hwstate = read_logical_state(dd); | 900 | int hwstate = read_logical_state(dd); |
900 | 901 | ||
901 | if (hwstate != LSTATE_ACTIVE) { | 902 | if (hwstate != LSTATE_ACTIVE) { |