mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 15:18:19 +00:00
atm: idt77252: fix null-ptr-dereference
[ Upstream commit 4416e98594
]
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>
This commit is contained in:
parent
6b2844ad7b
commit
981ba9c9a5
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue