diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2016-12-07 14:22:03 +0300 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2017-01-26 19:40:23 +0300 |
commit | fce49ca92fcb32f06c450f02b197d5cb209743dc (patch) | |
tree | 65f3829fd5ee29ae95fb572ed4880716b96d8674 /drivers | |
parent | fa5e29d5d65fd6eb4616125410f144e7dae26707 (diff) | |
download | linux-fce49ca92fcb32f06c450f02b197d5cb209743dc.tar.xz |
ser_gigaset: return -ENOMEM on error instead of success
[ Upstream commit 93a97c50cbf1c007caf12db5cc23e0d5b9c8473c ]
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: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/isdn/gigaset/ser-gigaset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/isdn/gigaset/ser-gigaset.c b/drivers/isdn/gigaset/ser-gigaset.c index 3ac9c4194814..53dfe1693e50 100644 --- a/drivers/isdn/gigaset/ser-gigaset.c +++ b/drivers/isdn/gigaset/ser-gigaset.c @@ -787,8 +787,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) { |