Patch "cosa: Add missing kfree in error path of cosa_write" has been added to the 5.9-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

    cosa: Add missing kfree in error path of cosa_write

to the 5.9-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:
     cosa-add-missing-kfree-in-error-path-of-cosa_write.patch
and it can be found in the queue-5.9 subdirectory.

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



commit f3f08c5fe957ce3c92b1a207487b942ff64ee46e
Author: Wang Hai <wanghai38@xxxxxxxxxx>
Date:   Tue Nov 10 22:46:14 2020 +0800

    cosa: Add missing kfree in error path of cosa_write
    
    [ Upstream commit 52755b66ddcef2e897778fac5656df18817b59ab ]
    
    If memory allocation for 'kbuf' succeed, cosa_write() doesn't have a
    corresponding kfree() in exception handling. Thus add kfree() for this
    function implementation.
    
    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
    Signed-off-by: Wang Hai <wanghai38@xxxxxxxxxx>
    Acked-by: Jan "Yenya" Kasprzak <kas@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20201110144614.43194-1-wanghai38@xxxxxxxxxx
    Signed-off-by: Jakub Kicinski <kuba@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/net/wan/cosa.c b/drivers/net/wan/cosa.c
index f8aed0696d775..2369ca250cd65 100644
--- a/drivers/net/wan/cosa.c
+++ b/drivers/net/wan/cosa.c
@@ -889,6 +889,7 @@ static ssize_t cosa_write(struct file *file,
 			chan->tx_status = 1;
 			spin_unlock_irqrestore(&cosa->lock, flags);
 			up(&chan->wsem);
+			kfree(kbuf);
 			return -ERESTARTSYS;
 		}
 	}



[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