summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWei Yongjun <weiyongjun1@huawei.com>2020-04-27 16:22:20 +0300
committerDavid S. Miller <davem@davemloft.net>2020-05-14 01:33:43 +0300
commit9ef391bdc29f0570c2be578210e220d15ea7a453 (patch)
tree38587d12142b8c3b50e475bb019a38db63d4111b
parent60da7d0bc7482a30817c73fdc8152123d19919f8 (diff)
downloadlinux-9ef391bdc29f0570c2be578210e220d15ea7a453.tar.xz
tty: vcc: Fix error return code in vcc_probe()
Fix to return negative error code -ENOMEM from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/tty/vcc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index d2a1e1228c82..9ffd42e333b8 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -605,6 +605,7 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
port->index = vcc_table_add(port);
if (port->index == -1) {
pr_err("VCC: no more TTY indices left for allocation\n");
+ rv = -ENOMEM;
goto free_ldc;
}