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: 2869b23e4b
("[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>
This commit is contained in:
parent
7b8076ce8a
commit
93a97c50cb
@ -755,8 +755,10 @@ static int __init ser_gigaset_init(void)
|
|||||||
driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
|
driver = gigaset_initdriver(GIGASET_MINOR, GIGASET_MINORS,
|
||||||
GIGASET_MODULENAME, GIGASET_DEVNAME,
|
GIGASET_MODULENAME, GIGASET_DEVNAME,
|
||||||
&ops, THIS_MODULE);
|
&ops, THIS_MODULE);
|
||||||
if (!driver)
|
if (!driver) {
|
||||||
|
rc = -ENOMEM;
|
||||||
goto error;
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc);
|
rc = tty_register_ldisc(N_GIGASET_M101, &gigaset_ldisc);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user