From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752928AbdC0NHR (ORCPT ); Mon, 27 Mar 2017 09:07:17 -0400 Received: from mail-lf0-f42.google.com ([209.85.215.42]:32804 "EHLO mail-lf0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752109AbdC0NHM (ORCPT ); Mon, 27 Mar 2017 09:07:12 -0400 Date: Mon, 27 Mar 2017 15:06:53 +0200 From: Johan Hovold To: Peter Rosin Cc: Greg Kroah-Hartman , Wolfram Sang , Rob Herring , Mark Rutland , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jonathan Corbet , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, Andrew Morton , Colin Ian King , Paul Gortmaker Subject: Re: [PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero Message-ID: <20170327130653.GA15708@localhost> References: <1490617069-13119-1-git-send-email-peda@axentia.se> <1490617069-13119-12-git-send-email-peda@axentia.se> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1490617069-13119-12-git-send-email-peda@axentia.se> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 27, 2017 at 02:17:48PM +0200, Peter Rosin wrote: > Comparing a size_t with less than zero is always false as size_t > is unsigned. So, change the type of the variable to ssize_t and > replicate the size check from mux_configure_channel() into > mux_write_ext_info() thus ensuring that the size will fit in the > ssize_t variable. > > Detected by CoverityScan, CID#1415278 ("Unsigned compared against 0") > > Fixes: 1da8e16d2812 ("iio: multiplexer: new iio category and iio-mux driver") You should fold this one and the next patch into the patches that they fix up instead fixing stuff that's not yet merged incrementally like you do here (specifically, the SHA id above will have no matching commit). Johan From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johan Hovold Subject: Re: [PATCH v11 11/12] iio: multiplexer: fix unsigned check with less than zero Date: Mon, 27 Mar 2017 15:06:53 +0200 Message-ID: <20170327130653.GA15708@localhost> References: <1490617069-13119-1-git-send-email-peda@axentia.se> <1490617069-13119-12-git-send-email-peda@axentia.se> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1490617069-13119-12-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Peter Rosin Cc: Greg Kroah-Hartman , Wolfram Sang , Rob Herring , Mark Rutland , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jonathan Corbet , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrew Morton , Colin Ian King , Paul Gortmaker List-Id: devicetree@vger.kernel.org On Mon, Mar 27, 2017 at 02:17:48PM +0200, Peter Rosin wrote: > Comparing a size_t with less than zero is always false as size_t > is unsigned. So, change the type of the variable to ssize_t and > replicate the size check from mux_configure_channel() into > mux_write_ext_info() thus ensuring that the size will fit in the > ssize_t variable. > > Detected by CoverityScan, CID#1415278 ("Unsigned compared against 0") > > Fixes: 1da8e16d2812 ("iio: multiplexer: new iio category and iio-mux driver") You should fold this one and the next patch into the patches that they fix up instead fixing stuff that's not yet merged incrementally like you do here (specifically, the SHA id above will have no matching commit). Johan -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html