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] [thread-next>] [day] [month] [year] [list]
Message-ID: <Zj4_BBsUYuAeiOpr@smile.fi.intel.com>
Date: Fri, 10 May 2024 18:36:36 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Bingbu Cao <bingbu.cao@...el.com>,
	Mauro Carvalho Chehab <mchehab@...nel.org>,
	Sakari Ailus <sakari.ailus@...ux.intel.com>,
	Hans de Goede <hdegoede@...hat.com>,
	Daniel Scally <dan.scally@...asonboard.com>,
	linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] media: ipu-bridge: fix error code in ipu_bridge_init()

On Fri, May 10, 2024 at 06:27:30PM +0300, Dan Carpenter wrote:
> On Fri, May 10, 2024 at 06:18:22PM +0300, Andy Shevchenko wrote:
> > On Fri, May 10, 2024 at 06:10:37PM +0300, Dan Carpenter wrote:
> > > Return -EINVAL if "bridge->n_sensors == 0".  Don't return success.

..

> > >  	ret = ipu_bridge_connect_sensors(bridge);
> > > -	if (ret || bridge->n_sensors == 0)
> > > +	if (ret || bridge->n_sensors == 0) {
> > > +		ret = ret ?: -EINVAL;
> > >  		goto err_unregister_ipu;
> > > +	}
> > 
> > I would split:
> > 
> > 	ret = ipu_bridge_connect_sensors(bridge);
> > 	if (ret)
> > 		goto err_unregister_ipu;
> > 
> > 	if (bridge->n_sensors == 0) {
> > 		ret = -EINVAL;
> > 		goto err_unregister_ipu;
> > 	}
> 
> It's always hard to know which way to go on these...  I wrote it that
> way in my first draft.  It's my prefered way as well but not everyone
> agrees.  I'll resend.

Is the generated assembly the same?

-- 
With Best Regards,
Andy Shevchenko



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ