Patch "atm: uPD98402: fix incorrect allocation" has been added to the 5.11-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    atm: uPD98402: fix incorrect allocation

to the 5.11-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     atm-upd98402-fix-incorrect-allocation.patch
and it can be found in the queue-5.11 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit c16f106640dfa756e014186d123607ca2ee0d3f3
Author: Tong Zhang <ztong0001@xxxxxxxxx>
Date:   Sun Mar 7 22:25:29 2021 -0500

    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@xxxxxxxxx>
    Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

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));



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux