summaryrefslogtreecommitdiff
path: root/drivers/atm
diff options
context:
space:
mode:
authorTong Zhang <ztong0001@gmail.com>2021-03-08 06:25:29 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 15:31:50 +0300
commitf35954a3961b71e6ad0667cd7bb8f430f3401aaa (patch)
treecb874e8c7aee2b7d3340c13d1ad1952cfe13ce42 /drivers/atm
parent852143ed96e2cac4a973041a24f443cc6315e055 (diff)
downloadlinux-f35954a3961b71e6ad0667cd7bb8f430f3401aaa.tar.xz
atm: uPD98402: fix incorrect allocation
[ Upstream commit 3153724fc084d8ef640c611f269ddfb576d1dcb1 ] dev->dev_data is set in zatm.c, calling zatm_start() will overwrite this dev->dev_data in uPD98402_start() and a subsequent PRIV(dev)->lock (i.e dev->phy_data->lock) will result in a null-ptr-dereference. I believe this is a typo and what it actually want to do is to allocate phy_data instead of dev_data. 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/uPD98402.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/atm/uPD98402.c b/drivers/atm/uPD98402.c
index 7850758b5bb8..239852d85558 100644
--- a/drivers/atm/uPD98402.c
+++ b/drivers/atm/uPD98402.c
@@ -211,7 +211,7 @@ static void uPD98402_int(struct atm_dev *dev)
static int uPD98402_start(struct atm_dev *dev)
{
DPRINTK("phy_start\n");
- if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
+ if (!(dev->phy_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL)))
return -ENOMEM;
spin_lock_init(&PRIV(dev)->lock);
memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats));