summaryrefslogtreecommitdiff
path: root/drivers/atm
diff options
context:
space:
mode:
authorTong Zhang <ztong0001@gmail.com>2021-03-07 22:25:30 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 14:35:21 +0200
commit981ba9c9a5297b945ff088a4dbe524d16cf6ffa3 (patch)
tree72021190b3df0131b568b57e5441206463a30466 /drivers/atm
parent6b2844ad7b17f008cceca201baf59e72012148a1 (diff)
atm: idt77252: fix null-ptr-dereference
[ Upstream commit 4416e98594dc04590ebc498fc4e530009535c511 ] this one is similar to the phy_data allocation fix in uPD98402, the driver allocate the idt77105_priv and store to dev_data but later dereference using dev->dev_data, which will cause null-ptr-dereference. fix this issue by changing dev_data to phy_data so that PRIV(dev) can work correctly. Signed-off-by: Tong Zhang <ztong0001@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/atm')
-rw-r--r--drivers/atm/idt77105.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/atm/idt77105.c b/drivers/atm/idt77105.c
index 63871859e6e8..52c2878b755d 100644
--- a/drivers/atm/idt77105.c
+++ b/drivers/atm/idt77105.c
@@ -262,7 +262,7 @@ static int idt77105_start(struct atm_dev *dev)
{
unsigned long flags;
- if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
+ if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL)))
return -ENOMEM;
PRIV(dev)->dev = dev;
spin_lock_irqsave(&idt77105_priv_lock, flags);
@@ -337,7 +337,7 @@ static int idt77105_stop(struct atm_dev *dev)
else
idt77105_all = walk->next;
dev->phy = NULL;
- dev->dev_data = NULL;
+ dev->phy_data = NULL;
kfree(walk);
break;
}