lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180319071435.svpg72uomxfc6hoj@mwanda>
Date:   Mon, 19 Mar 2018 10:14:35 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     Ji-Hun Kim <ji_hun.kim@...sung.com>
Cc:     mchehab@...nel.org, gregkh@...uxfoundation.org,
        arvind.yadav.cs@...il.com, linux-media@...r.kernel.org,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        kernel-janitors@...r.kernel.org
Subject: Re: Re: [PATCH] staging: media: davinci_vpfe: add error handling on
 kmalloc failure

On Mon, Mar 19, 2018 at 01:24:57PM +0900, Ji-Hun Kim wrote:
> >   1294                          } else if (to && !from && size) {
> >   1295                                  rval = module_if->set(ipipe, NULL);
> >   1296                                  if (rval)
> >   1297                                          goto error;
> > 
> > And here again goto free_params.
> > 
> >   1298                          }
> >   1299                          kfree(params);
> >   1300                  }
> >   1301          }
> >   1302  error:
> >   1303          return rval;
> > 
> > 
> > Change this to:
> > 
> > 	return 0;
> Instead of returning rval, returning 0 would be fine? It looks that should
> return rval in normal case.
> 

In the proposed code, the errors all do a return or a goto so "rval"
would be zero here.  Then the error path would look like:

err_free_params:
	kfree(params);
	return rval;
}

regards,
dan carpenter


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ