netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ser_gigaset: return -ENOMEM on error instead of success
@ 2016-12-07 11:22 Dan Carpenter
  2016-12-07 19:06 ` Paul Bolle
  2016-12-08 19:19 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Carpenter @ 2016-12-07 11:22 UTC (permalink / raw)
  To: Paul Bolle, Tilman Schmidt
  Cc: Karsten Keil, David S. Miller, gigaset307x-common, netdev,
	kernel-janitors

If we can't allocate the resources in gigaset_initdriver() then we
should return -ENOMEM instead of zero.

Fixes: 2869b23e4b95 ("[PATCH] drivers/isdn/gigaset: new M101 driver (v2)")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
Ancient code.

diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c
index d1f8ab915b15..b90776ef56ec 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -755,8 +755,10 @@ static int __init ser_gigaset_init(void)
 	driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
 				    GIGASET_MODULENAME, GIGASET_DEVNAME,
 				    &ops, THIS_MODULE);
-	if (!driver)
+	if (!driver) {
+		rc = -ENOMEM;
 		goto error;
+	}
 
 	rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc);
 	if (rc != 0) {

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-12-09  9:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-07 11:22 [patch] ser_gigaset: return -ENOMEM on error instead of success Dan Carpenter
2016-12-07 19:06 ` Paul Bolle
2016-12-07 20:57   ` Tilman Schmidt
2016-12-07 21:08     ` Paul Bolle
2016-12-07 22:04       ` Tilman Schmidt
2016-12-09  9:03         ` Paul Bolle
2016-12-08 19:19 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).