Re: [PATCH 6/6] lib/scatterlist: Fix overflow check in sgl_alloc_order
From: Bart Van Assche
Date: Wed Oct 03 2018 - 11:35:01 EST
On Wed, 2018-09-26 at 15:16 +-0100, Tvrtko Ursulin wrote:
+AD4 From: Tvrtko Ursulin +ADw-tvrtko.ursulin+AEA-intel.com+AD4
+AD4
+AD4 It is necessary to ensure types on both sides of the comparison are of the
+AD4 same width. Otherwise the check overflows sooner than expect due left hand
+AD4 side being an unsigned long length, and the right hand side unsigned int
+AD4 number of elements multiplied by element size.
Reviewed-by: Bart Van Assche +ADw-bvanassche+AEA-acm.org+AD4