]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd: Fix a size parameter in test_readonly()
authorDan Carpenter <dan.carpenter@linaro.org>
Tue, 25 Jul 2023 06:50:26 +0000 (09:50 +0300)
committerTom Rini <trini@konsulko.com>
Tue, 8 Aug 2023 21:05:43 +0000 (17:05 -0400)
The parentheses are in the wrong place so this passes the number of
bytes to write as "sizeof(index_0) != TPM_SUCCESS" when just
"sizeof(index_0)" was intended.  (1 byte vs 4 bytes).

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
cmd/tpm_test.c

index c4ed8e5901205b336d2e6ddc0eacc79950a4cd85..9bdc9c660fd0089892114fd1729977cb7cfbd1a1 100644 (file)
@@ -294,8 +294,8 @@ static int test_readonly(struct udevice *dev)
         */
        index_0 += 1;
        if (tpm_nv_write_value(dev, INDEX0, (uint8_t *)&index_0,
-                              sizeof(index_0) !=
-               TPM_SUCCESS)) {
+                              sizeof(index_0)) !=
+               TPM_SUCCESS) {
                pr_err("\tcould not write index 0\n");
        }
        tpm_nv_write_value_lock(dev, INDEX0);