[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20171019.130450.2201375945281744526.davem@davemloft.net>
Date: Thu, 19 Oct 2017 13:04:50 +0100 (WEST)
From: David Miller <davem@...emloft.net>
To: dan.carpenter@...cle.com
Cc: andreas.noever@...il.com, michael.jamet@...el.com,
mika.westerberg@...ux.intel.com, yehezkel.bernat@...el.com,
netdev@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 1/2 v2 net-next] thunderbolt: Fix a couple right
shifting to zero bugs
From: Dan Carpenter <dan.carpenter@...cle.com>
Date: Tue, 17 Oct 2017 15:32:17 +0300
> The problematic code looks like this:
>
> res_seq = res_hdr->xd_hdr.length_sn & TB_XDOMAIN_SN_MASK;
> res_seq >>= TB_XDOMAIN_SN_SHIFT;
>
> TB_XDOMAIN_SN_SHIFT is 27, and right shifting a u8 27 bits is always
> going to result in zero. The fix is to declare these variables as u32.
>
> Fixes: d1ff70241a27 ("thunderbolt: Add support for XDomain discovery protocol")
> Signed-off-by: Dan Carpenter <dan.carpenter@...cle.com>
Applied.
Powered by blists - more mailing lists