From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38111C43463 for ; Fri, 18 Sep 2020 02:58:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03F5F2083B for ; Fri, 18 Sep 2020 02:58:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600397915; bh=+8zcmXZJ6yBrRp+sgI7MDoip1ErVsbFrDnQmMDqs1Z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=EKrYrZjlVMKZewN1Ulv/1NvEOIiF4nmJaVpIHUDMT2vc8644qTxdg9UsScdOKWKFL OJUOoP2XFXBgRgVfcYSJCIk0UpTwxqw57MAlO0WU+0agoMrXSSseABkKxw7/fLNvA8 vnpBFq/JZwNBrRAfAtQTbEU7VFaGwlhBo1YfJ2Rc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728333AbgIRC6d (ORCPT ); Thu, 17 Sep 2020 22:58:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:55092 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbgIRCGP (ORCPT ); Thu, 17 Sep 2020 22:06:15 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1FA07238E5; Fri, 18 Sep 2020 02:06:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600394772; bh=+8zcmXZJ6yBrRp+sgI7MDoip1ErVsbFrDnQmMDqs1Z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cs5tPrAN39pPARP75QllHx+XWldQJw3obrpv49NnGM7aTz5ENnzZW0YaqF9SfD9SE ynJ/uFEhIESADvIhAik3f8Jnxb9IK4TpgA5ZWjPquGHQSO+gKtLoRHQ3SZm+2gwERs ENxG3G6dPluYyL/OY0NUoPCb8Chbvv8Ep41pdzoQ= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Wei Yongjun , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 5.4 247/330] sparc64: vcc: Fix error return code in vcc_probe() Date: Thu, 17 Sep 2020 21:59:47 -0400 Message-Id: <20200918020110.2063155-247-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200918020110.2063155-1-sashal@kernel.org> References: <20200918020110.2063155-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit ff62255a2a5c1228a28f2bb063646f948115a309 ] 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 Link: https://lore.kernel.org/r/20200427122415.47416-1-weiyongjun1@huawei.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/tty/vcc.c | 1 + 1 file changed, 1 insertion(+) 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; } -- 2.25.1