mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: David Binderman <dcb314@hotmail.com>,
	"andrew.donnellan@au1.ibm.com" <andrew.donnellan@au1.ibm.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: linux-4.16-rc1/drivers/misc/ocxl/file.c:320:broken error checking ?
Date: Mon, 12 Feb 2018 10:53:02 +0100	[thread overview]
Message-ID: <6e051309-c236-7715-cffb-b53d2da600b3@linux.vnet.ibm.com> (raw)
In-Reply-To: <HE1PR0802MB23312F7C9FFE65D802F9D0259CF70@HE1PR0802MB2331.eurprd08.prod.outlook.com>



Le 12/02/2018 à 09:58, David Binderman a écrit :
> Hello there,
> 
> 
> linux-4.16-rc1/drivers/misc/ocxl/file.c:320]: (style) Checking if 
> unsigned variable 'used' is less than zero.
> 
> Source code is
> 
> 
>         used = append_xsl_error(ctx, &header, buf + sizeof(header));
>          if (used < 0)
>              return used;
> 
> Suggest put return value from function into signed variable, sanity 
> check it,
> 
> then assign it to an unsigned variable.
> 
> 
> Also, use of the gcc compiler flag -Wtype-limits will show up this kind 
> of problem in future.

Thanks for reporting it. A patch to address it is working its way up and 
should land in the next rc release.

   Fred


> 
> Regards
> 
> 
> David Binderman
> 
> 

      reply	other threads:[~2018-02-12  9:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12  8:58 David Binderman
2018-02-12  9:53 ` Frederic Barrat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e051309-c236-7715-cffb-b53d2da600b3@linux.vnet.ibm.com \
    --to=fbarrat@linux.vnet.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=arnd@arndb.de \
    --cc=dcb314@hotmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®