]> git.baikalelectronics.ru Git - kernel.git/commitdiff
qed/qed_mng_tlv: correctly zero out ->min instead of ->hour
authorDaniil Tatianin <d-tatianin@yandex-team.ru>
Wed, 15 Mar 2023 19:46:18 +0000 (22:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Mar 2023 12:33:51 +0000 (13:33 +0100)
[ Upstream commit edab312f572997b109b92e49f7c3810966718112 ]

This fixes an issue where ->hour would erroneously get zeroed out
instead of ->min because of a bad copy paste.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Fixes: 9c31cbc89b33 ("qed: Add support for processing fcoe tlv request.")
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Link: https://lore.kernel.org/r/20230315194618.579286-1-d-tatianin@yandex-team.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qed/qed_mng_tlv.c

index 6190adf965bcab448a81a474d4faec0f6bb4eaa5..f55eed092f25d293a6ed567a3c93ad7da1af3429 100644 (file)
@@ -422,7 +422,7 @@ qed_mfw_get_tlv_time_value(struct qed_mfw_tlv_time *p_time,
        if (p_time->hour > 23)
                p_time->hour = 0;
        if (p_time->min > 59)
-               p_time->hour = 0;
+               p_time->min = 0;
        if (p_time->msec > 999)
                p_time->msec = 0;
        if (p_time->usec > 999)