Skip to content

Commit

Permalink
acpi/nfit: Block function zero DSMs
Browse files Browse the repository at this point in the history
In preparation for using function number 0 as an error value, prevent it
from being considered a valid function value by acpi_nfit_ctl().

Cc: <[email protected]>
Cc: stuart hayes <[email protected]>
Fixes: e02fb72 ("nfit: add Microsoft NVDIMM DSM command set...")
Reported-by: Jeff Moyer <[email protected]>
Reviewed-by: Jeff Moyer <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
djbw committed Jan 21, 2019
1 parent 1cd7386 commit 5e9e38d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/acpi/nfit/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,13 @@ static int acpi_nfit_add_dimm(struct acpi_nfit_desc *acpi_desc,
return 0;
}

/*
* Function 0 is the command interrogation function, don't
* export it to potential userspace use, and enable it to be
* used as an error value in acpi_nfit_ctl().
*/
dsm_mask &= ~1UL;

guid = to_nfit_uuid(nfit_mem->family);
for_each_set_bit(i, &dsm_mask, BITS_PER_LONG)
if (acpi_check_dsm(adev_dimm->handle, guid,
Expand Down

0 comments on commit 5e9e38d

Please sign in to comment.