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]
Date:	Fri, 16 Oct 2009 14:50:13 -0600
From:	Alex Chiang <achiang@...com>
To:	Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:	lenb@...nel.org, shaohua.li@...el.com,
	linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org
Subject: Re: [PATCH v2 1/6] ACPI: dock: clean up error handling paths in
	dock_add()

* Dmitry Torokhov <dmitry.torokhov@...il.com>:
> Hi Alex,
> 
> On Wed, Oct 14, 2009 at 04:46:16PM -0600, Alex Chiang wrote:
> > Remove some copy/paste code in our error handling paths, which makes
> > the function smaller and slightly easier to read.
> 
> Changing individual attributes into attribute_group would greatly
> simplify the code.

Good advice, I'll do this, thanks.

> > @@ -968,11 +968,9 @@ static int dock_add(acpi_handle handle)
> >  		platform_device_register_simple(dock_device_name,
> >  			dock_station_count, NULL, 0);
> >  	dock_device = dock_station->dock_device;
> > -	if (IS_ERR(dock_device)) {
> > -		kfree(dock_station);
> > -		dock_station = NULL;
> > -		return PTR_ERR(dock_device);
> > -	}
> > +	ret = IS_ERR(dock_device) ? PTR_ERR(dock_device) : 0;
> > +	if (ret)
> > +		goto out;
> 
> I think
> 
> 	if (IS_ERR(dock_device)) {
> 		ret = PTR_ERR(dock_device);
> 		goto out;
> 	}
> 
> is more commonly used form.

Ok, I'll change to the more idiomatic form.

Thanks for the review.

/ac

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ