mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 09:11:26 +03:00
PCI: edma_test: Fix Coverity issues
Validate num_chans before using for division Bug 3956683 Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com> Change-Id: I8abca2a251748711f07ffc14d71b1601fa73806f Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2876298 Reviewed-by: svcacv <svcacv@nvidia.com> Reviewed-by: Manikanta Maddireddy <mmaddireddy@nvidia.com> Reviewed-by: Bitan Biswas <bbiswas@nvidia.com> GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
ff5e03daaf
commit
b3bfce4122
@@ -2,7 +2,7 @@
|
||||
/*
|
||||
* PCIe DMA EPF Library for Tegra PCIe
|
||||
*
|
||||
* Copyright (C) 2022 NVIDIA Corporation. All rights reserved.
|
||||
* Copyright (C) 2022-2023 NVIDIA Corporation. All rights reserved.
|
||||
*/
|
||||
|
||||
#ifndef TEGRA_PCIE_EDMA_TEST_COMMON_H
|
||||
@@ -196,7 +196,9 @@ static int edmalib_common_test(struct edmalib_common *edma)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (num_chans != 0)
|
||||
nents_per_ch = nents / num_chans;
|
||||
|
||||
if (nents_per_ch == 0) {
|
||||
dev_err(edma->fdev, "%s: nents(%d) < enabled chanes(%d)\n",
|
||||
__func__, nents, num_chans);
|
||||
|
||||
Reference in New Issue
Block a user