[lkml]   [2019]   [Sep]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH][next] io_uring: ensure variable ret is initialized to zero
On Thu, Sep 26, 2019 at 11:56:30AM +0200, Jens Axboe wrote:
> On 9/26/19 11:50 AM, Colin King wrote:
> > From: Colin Ian King <>
> >
> > In the case where sig is NULL the error variable ret is not initialized
> > and may contain a garbage value on the final checks to see if ret is
> > -ERESTARTSYS. Best to initialize ret to zero before the do loop to
> > ensure the ret does not accidentially contain -ERESTARTSYS before the
> > loop.
> Oops, weird it didn't complain. I've folded in this fix, as that commit
> isn't upstream yet. Thanks!

There is a bug in GCC where at certain optimization levels, instead of
complaining, it initializes it to zero.

dan carpenter

 \ /
  Last update: 2019-09-26 13:35    [W:0.039 / U:19.612 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site