From: Wei Yongjun Date: Mon, 27 Apr 2020 13:22:20 +0000 (+0000) Subject: tty: vcc: Fix error return code in vcc_probe() X-Git-Tag: v5.8-rc1~98^2^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9ef391bdc29f0570c2be578210e220d15ea7a453;p=thirdparty%2Fkernel%2Flinux.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c index d2a1e1228c82d..9ffd42e333b83 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; }