* + rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev.patch added to -mm tree
@ 2020-09-22 17:09 akpm
0 siblings, 0 replies; only message in thread
From: akpm @ 2020-09-22 17:09 UTC (permalink / raw)
To: mm-commits, mporter, madhuparnabhowmik10, keescook, jhubbard,
gustavoars, dan.carpenter, alex.bou9, jingxiangfeng
The patch titled
Subject: rapidio: fix the missed put_device() for rio_mport_add_riodev
has been added to the -mm tree. Its filename is
rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev.patch
This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a
reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
The -mm tree is included into linux-next and is updated
there every 3-4 working days
------------------------------------------------------
From: Jing Xiangfeng <jingxiangfeng@huawei.com>
Subject: rapidio: fix the missed put_device() for rio_mport_add_riodev
rio_mport_add_riodev() misses to call put_device() when the device already
exists. Add the missed function call to fix it.
Link: https://lkml.kernel.org/r/20200922072525.42330-1-jingxiangfeng@huawei.com
Fixes: e8de370188d0 ("rapidio: add mport char device driver")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Alexandre Bounine <alex.bou9@gmail.com>
Cc: Gustavo A. R. Silva <gustavoars@kernel.org>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Kees Cook <keescook@chromium.org>
Cc: Madhuparna Bhowmik <madhuparnabhowmik10@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
drivers/rapidio/devices/rio_mport_cdev.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/rapidio/devices/rio_mport_cdev.c~rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev
+++ a/drivers/rapidio/devices/rio_mport_cdev.c
@@ -1680,6 +1680,7 @@ static int rio_mport_add_riodev(struct m
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 m
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;
}
_
Patches currently in -mm which might be from jingxiangfeng@huawei.com are
rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-09-22 17:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 17:09 + rapidio-fix-the-missed-put_device-for-rio_mport_add_riodev.patch added to -mm tree akpm
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.