Commit a335f078 authored by Alexandre Courbot's avatar Alexandre Courbot Committed by Ben Skeggs
Browse files

drm/nouveau/secboot: make sure requested falcons are supported



Check at contruction time that we have support for all the LS firmwares
asked by the caller.

Signed-off-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 489a5fe8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -888,6 +888,13 @@ acr_r352_new_(const struct acr_r352_func *func,
	      unsigned long managed_falcons)
{
	struct acr_r352 *acr;
	int i;

	/* Check that all requested falcons are supported */
	for_each_set_bit(i, &managed_falcons, NVKM_SECBOOT_FALCON_END) {
		if (!func->ls_func[i])
			return ERR_PTR(-ENOTSUPP);
	}

	acr = kzalloc(sizeof(*acr), GFP_KERNEL);
	if (!acr)