Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4b2530d8 authored by Kees Cook's avatar Kees Cook Committed by Mimi Zohar
Browse files

firmware: clean up filesystem load exit path



This makes the error and success paths more readable while trying to
load firmware from the filesystem.

Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Cc: David Howells <dhowells@redhat.com>
Acked-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
Signed-off-by: default avatarMimi Zohar <zohar@linux.vnet.ibm.com>
parent 5275d194
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -361,19 +361,17 @@ static int fw_get_filesystem_firmware(struct device *device,
			continue;
		rc = fw_read_file_contents(file, buf);
		fput(file);
		if (rc)
		if (rc) {
			dev_warn(device, "loading %s failed with error %d\n",
				 path, rc);
		else
			break;
			continue;
		}
	__putname(path);

	if (!rc) {
		dev_dbg(device, "direct-loading %s\n",
			buf->fw_id);
		fw_finish_direct_load(device, buf);
		break;
	}
	__putname(path);

	return rc;
}