Patch "rapidio: fix the missed put_device() for rio_mport_add_riodev" has been added to the 5.8-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

    rapidio: fix the missed put_device() for rio_mport_add_riodev

to the 5.8-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:
     rapidio-fix-the-missed-put_device-for-rio_mport_add_.patch
and it can be found in the queue-5.8 subdirectory.

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



commit ace99acf907caf959202a53f5dd2e4f544456331
Author: Jing Xiangfeng <jingxiangfeng@xxxxxxxxxx>
Date:   Thu Oct 15 20:13:18 2020 -0700

    rapidio: fix the missed put_device() for rio_mport_add_riodev
    
    [ Upstream commit 85094c05eeb47d195a74a25366a2db066f1c9d47 ]
    
    rio_mport_add_riodev() misses to call put_device() when the device already
    exists.  Add the missed function call to fix it.
    
    Fixes: e8de370188d0 ("rapidio: add mport char device driver")
    Signed-off-by: Jing Xiangfeng <jingxiangfeng@xxxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
    Cc: Matt Porter <mporter@xxxxxxxxxxxxxxxxxxx>
    Cc: Alexandre Bounine <alex.bou9@xxxxxxxxx>
    Cc: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
    Cc: John Hubbard <jhubbard@xxxxxxxxxx>
    Cc: Kees Cook <keescook@xxxxxxxxxxxx>
    Cc: Madhuparna Bhowmik <madhuparnabhowmik10@xxxxxxxxx>
    Link: https://lkml.kernel.org/r/20200922072525.42330-1-jingxiangfeng@xxxxxxxxxx
    Signed-off-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/rapidio/devices/rio_mport_cdev.c b/drivers/rapidio/devices/rio_mport_cdev.c
index 438cbf994c57f..152946e033d17 100644
--- a/drivers/rapidio/devices/rio_mport_cdev.c
+++ b/drivers/rapidio/devices/rio_mport_cdev.c
@@ -1680,6 +1680,7 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
 	struct rio_dev *rdev;
 	struct rio_switch *rswitch = NULL;
 	struct rio_mport *mport;
+	struct device *dev;
 	size_t size;
 	u32 rval;
 	u32 swpinfo = 0;
@@ -1694,8 +1695,10 @@ static int rio_mport_add_riodev(struct mport_cdev_priv *priv,
 	rmcd_debug(RDEV, "name:%s ct:0x%x did:0x%x hc:0x%x", dev_info.name,
 		   dev_info.comptag, dev_info.destid, dev_info.hopcount);
 
-	if (bus_find_device_by_name(&rio_bus_type, NULL, dev_info.name)) {
+	dev = bus_find_device_by_name(&rio_bus_type, NULL, dev_info.name);
+	if (dev) {
 		rmcd_debug(RDEV, "device %s already exists", dev_info.name);
+		put_device(dev);
 		return -EEXIST;
 	}
 



[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