Message ID | 20221202010410.gonna.444-kees@kernel.org |
---|---|
State | New |
Headers | show |
Series | [v2] crypto/caam: Avoid GCC constprop bug warning | expand |
diff --git a/drivers/crypto/caam/desc_constr.h b/drivers/crypto/caam/desc_constr.h index 62ce6421bb3f..d9da4173af9d 100644 --- a/drivers/crypto/caam/desc_constr.h +++ b/drivers/crypto/caam/desc_constr.h @@ -163,7 +163,8 @@ static inline void append_data(u32 * const desc, const void *data, int len) { u32 *offset = desc_end(desc); - if (len) /* avoid sparse warning: memcpy with byte count of 0 */ + /* Avoid GCC warning: memcpy with NULL dest (but byte count of 0). */ + if (data && len) memcpy(offset, data, len); (*desc) = cpu_to_caam32(caam32_to_cpu(*desc) +