mcb_probe() does not aqcuire a reference to the probed device but drops one
when removing the device. As it is actually using the device, it should grab
a reference via get_device().

This could lead to a panic found with a rmmod/modprobe stress test

Signed-off-by: Johannes Thumshirn <jthumsh...@suse.de>
Reported-by: Andreas Werner <andreas.wer...@men.de>
Tested-by: Andreas Werner <andreas.wer...@men.de>
---
 drivers/mcb/mcb-core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c
index b73c6e7..f5923c2 100644
--- a/drivers/mcb/mcb-core.c
+++ b/drivers/mcb/mcb-core.c
@@ -66,6 +66,7 @@ static int mcb_probe(struct device *dev)
        if (!found_id)
                return -ENODEV;
 
+       get_device(dev);
        return mdrv->probe(mdev, found_id);
 }
 
-- 
2.8.1

Reply via email to