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: <ZbKC3gLfNz301hRQ@bombadil.infradead.org>
Date: Thu, 25 Jan 2024 07:48:46 -0800
From: Luis Chamberlain <mcgrof@...nel.org>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Russ Weight <russ.weight@...ux.dev>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] firmware_loader: introduce __free() cleanup hanler

On Wed, Jan 17, 2024 at 12:33:07AM -0800, Dmitry Torokhov wrote:
> Define cleanup handler using facilities from linux/cleanup.h to simplify
> error handling in code using firmware loader. This will allow writing code
> like this:
> 
> int driver_update_firmware(...)
> {
> 	const struct firmware *fw_entry __free(firmware) = NULL;
> 	int error;
> 
> 	...
> 	error = request_firmware(&fw_entry, fw_name, dev);
> 	if (error) {
> 		dev_err(dev, "failed to request firmware %s: %d",
> 			fw_name, error);
> 		return error;
> 	}
> 
> 	error = check_firmware_valid(fw_entry);
> 	if (error)
> 		return error;
> 
> 	guard(mutex)(&instance->lock);
> 
> 	error = use_firmware(instance, fw);
> 	if (error)
> 		return error;
> 
> 	return 0;
> }
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@...il.com>

Acked-by: Luis Chamberalin <mcgrof@...nel.org>

  Luis

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ