]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
efi: stmm: Drop unneeded null pointer check
authorJan Kiszka <jan.kiszka@siemens.com>
Mon, 25 Aug 2025 16:07:13 +0000 (18:07 +0200)
committerArd Biesheuvel <ardb@kernel.org>
Tue, 26 Aug 2025 12:49:42 +0000 (14:49 +0200)
The API documenation of setup_mm_hdr does not mention that dptr can be
NULL, this is a local function, and no caller passes NULL. So drop the
unneeded check.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/stmm/tee_stmm_efi.c

index c2bc8467b09933bab20bd0f7b9e005f7fd34d576..65c0fe1ba275a35a85f6da6fbc88d1091f50ca6b 100644 (file)
@@ -185,8 +185,7 @@ static void *setup_mm_hdr(u8 **dptr, size_t payload_size, size_t func)
 
        var_hdr = (struct smm_variable_communicate_header *)mm_hdr->data;
        var_hdr->function = func;
-       if (dptr)
-               *dptr = comm_buf;
+       *dptr = comm_buf;
 
        return var_hdr->data;
 }