]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
IB/hfi1: Correct issues with sc5 computation
authorMike Marciniszyn <mike.marciniszyn@intel.com>
Fri, 1 Jul 2016 22:57:02 +0000 (15:57 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 16 Aug 2016 07:33:17 +0000 (09:33 +0200)
commit6ff49f18ef8203c03194f3cd39415a64195c3cb3
treef9b768af4fd590e434193e7a20cef66b883a880e
parent0416f25f81c757d01cec0622aac4c06247190e4a
IB/hfi1: Correct issues with sc5 computation

commit 896ce45da2c2f4abc508d443fdecde7de0b3fa7e upstream.

There are several computatations of the sc in the
ud receive routine.

Besides the code duplication, all are wrong when the
sc is greater than 15.   In that case the code incorrectly
or's a 1 into the computed sc instead of 1 shifted left
by 4.

Fix precomputed sc5 by using an already implemented routine
hdr2sc() and deleting flawed duplicated code.

Cc: Stable <stable@vger.kernel.org> # 4.6+
Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rdma/hfi1/ud.c