aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-12-07 06:22:03 -0500
committerDavid S. Miller <davem@davemloft.net>2016-12-08 14:19:17 -0500
commit93a97c50cbf1c007caf12db5cc23e0d5b9c8473c (patch)
tree4d4b6c892210d23fdbfdf4c2a55c1ff74909b5bf
parent7b8076ce8a00d553ae9d3b7eb5f0cc3e63cb16f1 (diff)
ser_gigaset: return -ENOMEM on error instead of success
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> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/isdn/gigaset/ser-gigaset.c4
1 files changed, 3 insertions, 1 deletions
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)
755 driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS, 755 driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
756 GIGASET_MODULENAME, GIGASET_DEVNAME, 756 GIGASET_MODULENAME, GIGASET_DEVNAME,
757 &ops, THIS_MODULE); 757 &ops, THIS_MODULE);
758 if (!driver) 758 if (!driver) {
759 rc = -ENOMEM;
759 goto error; 760 goto error;
761 }
760 762
761 rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc); 763 rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc);
762 if (rc != 0) { 764 if (rc != 0) {