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] [thread-next>] [day] [month] [year] [list]
Message-Id: <1428492040-5581-10-git-send-email-sudipm.mukherjee@gmail.com>
Date:	Wed,  8 Apr 2015 16:50:35 +0530
From:	Sudip Mukherjee <sudipm.mukherjee@...il.com>
To:	Arnd Bergmann <arnd@...db.de>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Jean Delvare <jdelvare@...e.de>,
	Wolfram Sang <wsa@...-dreams.de>,
	Rodolfo Giometti <giometti@...eenne.com>,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	Mark Brown <broonie@...nel.org>,
	Willy Tarreau <willy@...a-x.org>,
	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.de>
Cc:	linux-kernel@...r.kernel.org, linux-i2c@...r.kernel.org,
	netdev@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-spi@...r.kernel.org, devel@...verdev.osuosl.org,
	alsa-devel@...a-project.org,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH 09/14] pps: return proper error values from attach

now that we are monitoring the return value from attach, make the
required changes to return proper value from its attach function.

Signed-off-by: Sudip Mukherjee <sudip@...torindia.org>
---
 drivers/pps/generators/pps_gen_parport.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/pps/generators/pps_gen_parport.c b/drivers/pps/generators/pps_gen_parport.c
index dcd39fb..499f410 100644
--- a/drivers/pps/generators/pps_gen_parport.c
+++ b/drivers/pps/generators/pps_gen_parport.c
@@ -190,18 +190,18 @@ static inline ktime_t next_intr_time(struct pps_generator_pp *dev)
 			dev->port_write_time + 3 * SAFETY_INTERVAL));
 }
 
-static void parport_attach(struct parport *port)
+static int parport_attach(struct parport *port)
 {
 	if (attached) {
 		/* we already have a port */
-		return;
+		return -EALREADY;
 	}
 
 	device.pardev = parport_register_device(port, KBUILD_MODNAME,
 			NULL, NULL, NULL, PARPORT_FLAG_EXCL, &device);
 	if (!device.pardev) {
 		pr_err("couldn't register with %s\n", port->name);
-		return;
+		return -ENODEV;
 	}
 
 	if (parport_claim_or_block(device.pardev) < 0) {
@@ -218,10 +218,11 @@ static void parport_attach(struct parport *port)
 	device.timer.function = hrtimer_event;
 	hrtimer_start(&device.timer, next_intr_time(&device), HRTIMER_MODE_ABS);
 
-	return;
+	return 0;
 
 err_unregister_dev:
 	parport_unregister_device(device.pardev);
+	return -ENODEV;
 }
 
 static void parport_detach(struct parport *port)
-- 
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ