[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231107123600.14529-1-shum.sdl@nppct.ru>
Date: Tue, 7 Nov 2023 15:36:00 +0300
From: Andrey Shumilin <shum.sdl@...ct.ru>
To: 3chas3@...il.com
Cc: Andrey Shumilin <shum.sdl@...ct.ru>,
linux-atm-general@...ts.sourceforge.net,
netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
lvc-project@...uxtesting.org,
khoroshilov@...ras.ru,
ykarpov@...ras.ru,
vmerzlyakov@...ras.ru,
vefanov@...ras.ru
Subject: [PATCH] iphase: Adding a null pointer check
The pointer <dev->desc_tbl[i].iavcc> is dereferenced on line 195.
Further in the code, it is checked for null on line 204.
It is proposed to add a check before dereferencing the pointer.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Signed-off-by: Andrey Shumilin <shum.sdl@...ct.ru>
---
drivers/atm/iphase.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 324148686953..596422fbfacc 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -192,6 +192,11 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
i++;
continue;
}
+ if (!(iavcc_r = dev->desc_tbl[i].iavcc)) {
+ printk("Fatal err, desc table vcc or skb is NULL\n");
+ i++;
+ continue;
+ }
ltimeout = dev->desc_tbl[i].iavcc->ltimeout;
delta = jiffies - dev->desc_tbl[i].timestamp;
if (delta >= ltimeout) {
--
2.30.2
Powered by blists - more mailing lists