summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2016-12-07 14:22:03 +0300
committerBen Hutchings <ben@decadent.org.uk>2017-02-23 03:54:44 +0000
commitfd61e9c0a35a5c62b3a268c366cb57fee5646180 (patch)
tree06d1255207f932d20185337f561b12e4312624ea
parent6623e57d684b324de25dc1b936529f7b0fbd3a9a (diff)
downloadlinux-stable-fd61e9c0a35a5c62b3a268c366cb57fee5646180.tar.gz
linux-stable-fd61e9c0a35a5c62b3a268c366cb57fee5646180.tar.bz2
linux-stable-fd61e9c0a35a5c62b3a268c366cb57fee5646180.zip
ser_gigaset: return -ENOMEM on error instead of success
commit 93a97c50cbf1c007caf12db5cc23e0d5b9c8473c upstream. 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> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-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 0ebb52b0336d..397dba6d408f 100644
--- a/drivers/isdn/gigaset/ser-gigaset.c
+++ b/drivers/isdn/gigaset/ser-gigaset.c
@@ -791,8 +791,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) {