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-next>] [day] [month] [year] [list]
Date:	Mon, 04 Jan 2016 19:17:08 +0100
From:	Martin Fuzzey <mfuzzey@...keon.com>
To:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Uwe Kleine-König 
	<u.kleine-koenig@...gutronix.de>
Cc:	linux-kernel@...r.kernel.org
Subject: [PATCH] base/platform: Fix platform drivers with no probe callback
 (ex alarmtimer)

Normally, when a platform driver defines a .probe callback, the
result of dev_pm_domain_attach() is ignored unless it is EPROBE_DEFER.

However, when a .probe callback is not defined the result of
dev_pm_domain_attach() is propagated to the caller.

But dev_pm_domain_attach() can return -ENODEV for devices with no
power domain.

This was causing the alarmtimer .suspend() callback to be ignored
and hence alarms not to wake from suspend (since the RTC was
not being programmed on suspend).

Fixes: b8b2c7d [base/platform: assert that dev_pm_domain callbacks are called unconditionally]
Signed-off-by: Martin Fuzzey <mfuzzey@...keon.com>
---
 drivers/base/platform.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 1dd6d3b..61e5b7e 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -513,8 +513,8 @@ static int platform_drv_probe(struct device *_dev)
 		return ret;
 
 	ret = dev_pm_domain_attach(_dev, true);
-	if (ret != -EPROBE_DEFER && drv->probe) {
-		ret = drv->probe(dev);
+	if (ret != -EPROBE_DEFER) {
+		ret = drv->probe ? drv->probe(dev) : 0;
 		if (ret)
 			dev_pm_domain_detach(_dev, true);
 	}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ