From: Johannes Thumshirn Date: Tue, 10 May 2016 10:39:44 +0000 (+0200) Subject: mcb: Acquire reference to device in probe X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=7bc364097a89a0a9a5e5e4989d6b3e6fb2027a9e;p=openwrt%2Fstaging%2Fblogic.git mcb: Acquire reference to device in probe 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 Reported-by: Andreas Werner Tested-by: Andreas Werner Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/mcb/mcb-core.c b/drivers/mcb/mcb-core.c index b73c6e7d28e4..f5923c253f7e 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); }