qede: Fix memset corruption
[ Upstream commit e543468869
]
Thanks to Kees Cook who detected the problem of memset that starting
from not the first member, but sized for the whole struct.
The better change will be to remove the redundant memset and to clear
only the msix_cnt member.
Signed-off-by: Prabhakar Kushwaha <pkushwaha@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: Shai Malin <smalin@marvell.com>
Reported-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
5d7c8097ad
commit
54015fa25e
|
@ -1590,6 +1590,7 @@ static void qede_sync_free_irqs(struct qede_dev *edev)
|
|||
}
|
||||
|
||||
edev->int_info.used_cnt = 0;
|
||||
edev->int_info.msix_cnt = 0;
|
||||
}
|
||||
|
||||
static int qede_req_msix_irqs(struct qede_dev *edev)
|
||||
|
@ -2088,7 +2089,6 @@ static int qede_load(struct qede_dev *edev, enum qede_load_mode mode,
|
|||
goto out;
|
||||
err4:
|
||||
qede_sync_free_irqs(edev);
|
||||
memset(&edev->int_info.msix_cnt, 0, sizeof(struct qed_int_info));
|
||||
err3:
|
||||
qede_napi_disable_remove(edev);
|
||||
err2:
|
||||
|
|
Loading…
Reference in New Issue