lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20231020124324.54692-2-JoseJavier.Rodriguez@duagon.com>
Date:   Fri, 20 Oct 2023 12:44:32 +0000
From:   Rodríguez Barbarin, José Javier 
        <josejavier.rodriguez@...gon.com>
To:     "morbidrsa@...il.com" <morbidrsa@...il.com>,
        "gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "jth@...nel.org" <jth@...nel.org>,
        Sanjuán García, Jorge 
        <Jorge.SanjuanGarcia@...gon.com>,
        Rodríguez Barbarin, José Javier 
        <josejavier.rodriguez@...gon.com>,
        Sanjuán García, Jorge 
        <Jorge.SanjuanGarcia@...gon.com>
Subject: [PATCH 1/1] mcb: Use the actual bus passed to init and release
 functions

The functions mcb_bus_add_devices() and mcb_devices_unregister()
take a mcb_bus as argument that is never being used. This implies
that there is only one bus.

Do not ignore mcb_bus parameter and get the actual bus_type from
the device related to this mcb_bus.

Co-developed-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@...gon.com>
Signed-off-by: Jorge Sanjuan Garcia <jorge.sanjuangarcia@...gon.com>
Signed-off-by: Jose Javier Rodriguez Barbarin <JoseJavier.Rodriguez@...gon.com>
---
 drivers/mcb/mcb-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
index 5c6157b0db75..2a4a5e71ad4e 100644
--- a/drivers/mcb/mcb-core.c
+++ b/drivers/mcb/mcb-core.c
@@ -311,7 +311,7 @@ static int __mcb_devices_unregister(struct device *dev, void *data)
 
 static void mcb_devices_unregister(struct mcb_bus *bus)
 {
-	bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_devices_unregister);
+	bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_devices_unregister);
 }
 /**
  * mcb_release_bus() - Free a @mcb_bus
@@ -406,7 +406,7 @@ static int __mcb_bus_add_devices(struct device *dev, void *data)
  */
 void mcb_bus_add_devices(const struct mcb_bus *bus)
 {
-	bus_for_each_dev(&mcb_bus_type, NULL, NULL, __mcb_bus_add_devices);
+	bus_for_each_dev(bus->dev.bus, NULL, NULL, __mcb_bus_add_devices);
 }
 EXPORT_SYMBOL_NS_GPL(mcb_bus_add_devices, MCB);
 
-- 
2.34.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ