From patchwork Tue Feb 2 09:13:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 375912 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,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, UNPARSEABLE_RELAY, URIBL_BLOCKED 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 DA39AC433E9 for ; Tue, 2 Feb 2021 09:18:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9E89164E9E for ; Tue, 2 Feb 2021 09:18:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232960AbhBBJRd (ORCPT ); Tue, 2 Feb 2021 04:17:33 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:35682 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbhBBJQt (ORCPT ); Tue, 2 Feb 2021 04:16:49 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 1129ExLs039270; Tue, 2 Feb 2021 09:15:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type : in-reply-to; s=corp-2020-01-29; bh=XeW5vxg1oljfl4NXPYOgql+RYM8k8nJCK9uJMauzFyQ=; b=iFSps5hvLXTkb1IpbQtL4B+9QdQaiKeCoS6sZnAMrma4suhj/OQqd8hItpALHuAkaD+L KBf2c4Z+fTIBvnLxRXCfDFKhd492Mu60m8dhyzDq2vpVwuSAb60jbu5l52bdPECKtqU8 0T3/UHRgQIAQSa1YCuUN+aakiE5DU58bu1N6JjfWmzThHRdxEH4V1SNyz3xk34inkY72 dUWgAyE1G6fn3KQ5eKT1dbLAj0rdCLcAfpxSvp18KNF4n0ZHUXeL+KW5YdUzzuChLAWt STyT715+iN75/vVRF1ySKgZOZkQ9XHNRAclG03wC0DRj2wJmDYbCAUA5rpDulqDs0fSC pw== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by aserp2120.oracle.com with ESMTP id 36cydksmf6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Feb 2021 09:15:58 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 11299Trh073369; Tue, 2 Feb 2021 09:13:55 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 36dh1npd0v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 02 Feb 2021 09:13:55 +0000 Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 1129DqdL032702; Tue, 2 Feb 2021 09:13:53 GMT Received: from mwanda (/102.36.221.92) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 02 Feb 2021 01:13:52 -0800 Date: Tue, 2 Feb 2021 12:13:44 +0300 From: Dan Carpenter To: Vladimir Oltean Cc: Claudiu Manoil , Alexandre Belloni , UNGLinuxDriver@microchip.com, "David S. Miller" , Jakub Kicinski , Florian Fainelli , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH v3 2/2 net-next] net: mscc: ocelot: fix error code in mscc_ocelot_probe() Message-ID: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Mailer: git-send-email haha only kidding X-Proofpoint-IMR: 1 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9882 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 phishscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102020064 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=9882 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 adultscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 clxscore=1015 spamscore=0 lowpriorityscore=0 phishscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102020065 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Probe should return an error code if platform_get_irq_byname() fails but it returns success instead. Fixes: 6c30384eb1de ("net: mscc: ocelot: register devlink ports") Signed-off-by: Dan Carpenter Reviewed-by: Vladimir Oltean --- v3: rebase drivers/net/ethernet/mscc/ocelot_vsc7514.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mscc/ocelot_vsc7514.c b/drivers/net/ethernet/mscc/ocelot_vsc7514.c index b52e24826b10..6b6eb92149ba 100644 --- a/drivers/net/ethernet/mscc/ocelot_vsc7514.c +++ b/drivers/net/ethernet/mscc/ocelot_vsc7514.c @@ -1300,8 +1300,10 @@ static int mscc_ocelot_probe(struct platform_device *pdev) goto out_free_devlink; irq_xtr = platform_get_irq_byname(pdev, "xtr"); - if (irq_xtr < 0) + if (irq_xtr < 0) { + err = irq_xtr; goto out_free_devlink; + } err = devm_request_threaded_irq(&pdev->dev, irq_xtr, NULL, ocelot_xtr_irq_handler, IRQF_ONESHOT,