mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
atm: uPD98402: fix incorrect allocation
[ Upstream commit 3153724fc0
]
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>
This commit is contained in:
parent
40d0a9297f
commit
6b2844ad7b
1 changed files with 1 additions and 1 deletions
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue