Fix potential overflow in linear trees (#5395)
Fix potential overflow in linear trees (#5395)

* Fix potential overflow in linear trees

* simplify

Co-authored-by: James Lamb <4020df120d2dda32358fb55c9c66975f395dcd8d@gmail.com>
henry0312/LightGBM,henry0312/LightGBM,microsoft/LightGBM,microsoft/LightGBM,microsoft/LightGBM,microsoft/LightGBM,microsoft/LightGBM,henry0312/LightGBM,henry0312/LightGBM,henry0312/LightGBM