From ecaeac805b044f715c98960a8fbf19fe2b76ae6b Mon Sep 17 00:00:00 2001 From: Eric van Gyzen Date: Thu, 30 Mar 2023 18:27:06 -0500 Subject: mlxfw: fix potential NULL pointer dereference Reported by: Coverity (an internal run at Dell) Reviewed by: kib MFC after: 1 week Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D39348 --- sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c b/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c index 1b6080930724..78ddf10f359d 100644 --- a/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c +++ b/sys/dev/mlxfw/mlxfw_mfa2_tlv_multi.c @@ -60,6 +60,8 @@ mlxfw_mfa2_tlv_next(const struct mlxfw_mfa2_file *mfa2_file, if (tlv->type == MLXFW_MFA2_TLV_MULTI_PART) { multi = mlxfw_mfa2_tlv_multi_get(mfa2_file, tlv); + if (!multi) + return NULL; tlv_len = NLA_ALIGN(tlv_len + be16_to_cpu(multi->total_len)); } -- cgit v1.2.3