From patchwork Mon Feb 7 08:22:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12737029 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 44539C433FE for ; Mon, 7 Feb 2022 08:33:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244284AbiBGIbe (ORCPT ); Mon, 7 Feb 2022 03:31:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241620AbiBGIXm (ORCPT ); Mon, 7 Feb 2022 03:23:42 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9C02C043181; Mon, 7 Feb 2022 00:23:41 -0800 (PST) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2178ACxD009053; Mon, 7 Feb 2022 08:23:19 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2021-07-09; bh=SAK2bulSqWVUqCDX1sWm0a0IvAIJdWUekZd9WSQTlqM=; b=SR4YvTOqCwhUkRFVyp/+gATevWqelVt7eNIaLPONIzP+ZIOdppDO5Lmr2XNr7Zn3MVEy ngY7/aZNaN0QWRfhyqko+42+Z5e9epkRW8ceyqLgoPPeeSCoHfd7cWDsYHQ8fcK/QR77 N5pfdchDQgxiq5Zv+6bcQHu2bR4TH5W2WKuV+aBsNmZ4/mwiiUkeI6gdXjJ2chzPxI1g nLXcGB3YzdqwZn6Kk5EwX3RmqghFL0PQt6L4JGf13G0RyvbAyGBcHk2YSnoyCwQTN/Ya WP3/SnImoWlQQXQmTKJObWA73KJ2+a2UrsdfKK2KYXaThV9C9z+yVztULz92nFUsE5sC 9w== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 3e1fu2ne6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Feb 2022 08:23:16 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 2178FhUN029939; Mon, 7 Feb 2022 08:23:07 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by userp3030.oracle.com with ESMTP id 3e1ebwndqq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Feb 2022 08:23:06 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Vuqwcfc+sKrI3T6159zwW4qXu+WInQ2suCRigo23Y17BksyOqUKqyTaw3hK/Jx0zL0L6UwuA0DlZ93pookRXvGqtwAnaxKct/0ccyYb1opebVdxSeqLN7rU8ths0Z8WtwfGfJSgqQmC9EhnWgiamNq5xUajm5VkhDNsqjhZirUzDWyLOUuY+coJIHLgcdUs81mXxg85rk6Z7HCwk4Ci/JiVSNgBWIaJNktc5zNBbOBqgf/SrTS1zRqncrJQcVOunhbgpx9KZ2RnMdPLGiif653OK4LSEGsosBX9GafVRyz2+PX4HBjSsjW/cSInXCP9fnYVRoNnhlEpqG8JY5aXjdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=SAK2bulSqWVUqCDX1sWm0a0IvAIJdWUekZd9WSQTlqM=; b=L1Msr9JywWWSVuXM2dPu17itqHj6bYXEYssO07KjssZHELUmPp/Y/wO7qYJaezEv1U5CtD017To+tBhhOtFT3lGziRlGNiVknjsn/g/01dQrg3wx8o8og7OdQzVZXOWxNeRt9f4nAvkeSEND0xu9Rri0BBFY2yWzJJdO0zPwHFZPRHyoE9GcffJ7R2wLqEfLAI1RKV5WXvCfEE7t1QnWM2ON38Tu3SVExXglXPtNKcIcmbOLa7wgoSWQb7Jsn0D504ifhx3ekYARFb1fV0akHyKGAKvfdBZGeYa6eMAFApi0xJXE2J2uf+36DCFqBcsoIxUQPZtI+99CRhjQxnWZKg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SAK2bulSqWVUqCDX1sWm0a0IvAIJdWUekZd9WSQTlqM=; b=TVQnGsKWFzQ9PhLsZ0OjNpIXLV5wOzyq2d7+aQqnldsBExwBtQnockQmnd90obkIzi7vjVymsZHDG/3QbHfW4VkDtQyuVj+V9UH8binCTmwv1Xx1SboqFn6j7nGo94NHP3nB4mWWC7MGtVzZ2mpDpaNt4aDaOaJkXGBQpZI6znc= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by CH0PR10MB4986.namprd10.prod.outlook.com (2603:10b6:610:c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Mon, 7 Feb 2022 08:23:05 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::e5a5:8f49:7ec4:b7b8]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::e5a5:8f49:7ec4:b7b8%5]) with mapi id 15.20.4951.018; Mon, 7 Feb 2022 08:23:05 +0000 Date: Mon, 7 Feb 2022 11:22:53 +0300 From: Dan Carpenter To: Andrew Lunn , Russell King Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Marek =?iso-8859-1?q?Beh=FAn?= , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH 1/2 net-next] net: dsa: mv88e6xxx: Fix off by in one in mv88e6185_phylink_get_caps() Message-ID: <20220207082253.GA28514@kili> Content-Disposition: inline X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: ZR0P278CA0146.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:41::7) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0df8781c-fcf4-4dc4-7e0d-08d9ea13102a X-MS-TrafficTypeDiagnostic: CH0PR10MB4986:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:883; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ijuacKKkvi4Gxa7noWQ53e6mje+w/e9qpF7ZIOp9ZEni52L64EamsTOOBO4S1ffF/JPcSwVk+Ne2j7Owuq/EYrjuPMTkh66TFgutk4+6q9ia3/iabeZXhgvWz/j503Oy2WyapItq4x4M8nwgY2srIayw+I3euwsj9tUFAhIQG8quTC5yVAAqk+b8HM8IPppBQYr9HqZ9/9qzsENFQW3VfB9zDCaLhZjtXUd51AQYbObDXCKFRzYfQTr7TN7wTDncKlMVDtQFA46BJR/4cADNHJzDACsNT9dkoiO2h/sz65JwYGA3KMRU1KVA5JwEKedcr+cqQpr6ZMlEls5jJCkxTlDxJ4EX46YMfi8XVoUqrqDdbootL5PF8VfnK6PVZBJdCWRIYiMs2od7dldF7YkXqN0yUP/KKuaSAIfnKWl+gslNp5tjx1sT3t+PDAU6sVtnfDQ6jeUrFo1w2fCG0hGDHcI9DZNNC5GAZeyILNxhTsDq/ZOGPPOAJ2aDwWB/Ivyl5Tu9XmwAG3bAK+tqCDoGM2aIyT+mCn1Cu3rp/o/NgvtjQRJv1tg7zGNk0VyPPtPYxeU578rbMgupZMUgo3mnT6v4wRNixPccT0N/Bd7Hp12QrN0iwbN6U60WLvOoKpDJTjKMQmp+88eA5uSL0ercAgk9Cx/XBwC9u3NhK7sACAEatFYJxU/n0k9bNPDYklMID30cRNE9YRZGOPnpTEBvdw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(33716001)(8936002)(4744005)(4326008)(33656002)(66946007)(66476007)(8676002)(66556008)(110136005)(54906003)(316002)(508600001)(6512007)(9686003)(7416002)(44832011)(5660300002)(52116002)(6506007)(6486002)(6666004)(2906002)(1076003)(186003)(26005)(38350700002)(38100700002)(83380400001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6vEAG2MNmD1tRlmjKjvLguy33ssz9WJzS2UFQt+P73qEn3HmDq5JMhgn18N8jBHUcLvN9T2qGQ5UI0Xf5kZyCLewr1yOF1+YD2XFLfDKIkpEBm31+XMReMQhqYZ7LhxBQi8zabTeT14qqBWz5xEDmcAvVNMhICqdXnBaYsdZyBK8hBW1HQyJF0RSLxb6y7ju2yfsaPG9gSOtqSRY8iohyLfPxYJzWJ5xB3KUQKpFW7evyFh0RJLIuCR9QeuWhysA8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OJcW7H9/uUSXljVXFD/yzFzULgzdopGYqrxK+N+li+az/moE7r50TVhnl/+aUjPOk0ny/iSC5c9q/3rLQSSfeZjfne2hyMgGlYb/zG14djc58wZ7t/ZwRsOLkOiyoKh98HHwvzMY0gi9hVH7HcYjHZ4wSi3HaKpXZ5UW1eQeji94WQCIYavC+N8BhR9rp3SZ+s5lAKO1bJugtszEisiwbNZmWy1I8/AB1H/e7yfp9SBkAtaZiUQJss7kouQ07akc9FzrGnJAu+4du8sITUaxFfF54Qk2/JSKTAOP8xtIhjRTa0FM5TMSLmYFwC998ypCttmeFmGPklnK2Q8vQZ1d0eSxnIS86uWoCqzgQQ== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0df8781c-fcf4-4dc4-7e0d-08d9ea13102a X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2022 08:23:04.9259 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lMTQ5kp/o8Tyx+rP+4UBIBAYWSDwThz0VG+Col1553ABcaO+6YggHqlelUIp5AQMN0m9hRYjdfq6GAhmOfXouEAbvsB8wsNeGdpFUW+jUto= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4986 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10250 signatures=673430 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 adultscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202070054 X-Proofpoint-ORIG-GUID: KkgBuoB8y0liUbBoDrR49fwunxqqpefM X-Proofpoint-GUID: KkgBuoB8y0liUbBoDrR49fwunxqqpefM Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The <= ARRAY_SIZE() needs to be < ARRAY_SIZE() to prevent an out of bounds error. Fixes: d4ebf12bcec4 ("net: dsa: mv88e6xxx: populate supported_interfaces and mac_capabilities") Signed-off-by: Dan Carpenter Reviewed-by: Russell King (Oracle) --- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 7670796c2aa1..192a7688b4df 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -585,7 +585,7 @@ static void mv88e6185_phylink_get_caps(struct mv88e6xxx_chip *chip, int port, { u8 cmode = chip->ports[port].cmode; - if (cmode <= ARRAY_SIZE(mv88e6185_phy_interface_modes) && + if (cmode < ARRAY_SIZE(mv88e6185_phy_interface_modes) && mv88e6185_phy_interface_modes[cmode]) __set_bit(mv88e6185_phy_interface_modes[cmode], config->supported_interfaces); From patchwork Mon Feb 7 08:24:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12737028 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1409CC433EF for ; Mon, 7 Feb 2022 08:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243791AbiBGIbd (ORCPT ); Mon, 7 Feb 2022 03:31:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240388AbiBGIZE (ORCPT ); Mon, 7 Feb 2022 03:25:04 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09368C043185; Mon, 7 Feb 2022 00:25:04 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2178EwQH011697; Mon, 7 Feb 2022 08:24:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : in-reply-to : mime-version; s=corp-2021-07-09; bh=TgGJxtlyVN9YZ2AXuaeLhgvrEFZT3k4314+VywTXaOw=; b=wAz2GFUDouvggKCMyVXaAkjHExetFjhjAsK9bK6CV7tm0D0gwpLQmJ4EhMWamKkUKqPB qMgrKFcOS08MPe+nLqzk0LEodZ7oJiPyAMIi+N+tSQM49bpk9r1T0wjq4Zgftk9JtHGc RSV7SY+nVjwqCxNKRsYrgrYyOFlXB9zXP6harLGFQvCUESKGe/hj4jRgbo/3inS/kOFX 3OkHxZdmv9QfP+O0BbS/rtAJKd2fQ1Z2t89CAp5lSP32vR4Xeoq69hRUq3Y2fp2de603 0Q3KbsHq1crrVJrwHLjQyPHVlPC4n5IuYjcTICbBRdNnR4YOekkORQ8ZkyhorMgChPWS 2Q== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 3e1hsu5c6g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Feb 2022 08:24:55 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 2178FTsi066813; Mon, 7 Feb 2022 08:24:54 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2170.outbound.protection.outlook.com [104.47.57.170]) by aserp3020.oracle.com with ESMTP id 3e1h23yhw4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 07 Feb 2022 08:24:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=alCSF7sy14XYO6leNWJQWzJTlzxKZPbHJfgxqCL5fzz6kVM/WeJujS0wlnHxnXZUKcYeMmXNPbpLnhJqXiVYfFZ11zBzmYJzlEnYdSjJXnIuA6ixSt1sMz91V8e/p++FHC/Y6IfM1H+SEM59CLJ9aP31YerLFlTp2x9w0jQd2towxcLKxWOA634ZXshqEyv0z5RrbeJyTCWh1e/P7yMLIJst7UB8DFt4Q78Szf2ztm20O1Csg8eqUMIBMo+hiPIdL6pBrUYMeF648hfTEgEMdoKuKLwGbaebITd5y5pkcJx+MQ8VS/75Xcb70NJSYURfc3RNO7utkTTlULwnAA0fMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TgGJxtlyVN9YZ2AXuaeLhgvrEFZT3k4314+VywTXaOw=; b=YvaKjmtjUrpTGt1a/CKVSuHbGALsHsjsxW2kvTGxj4lzsG6hBldzoJz9umujOAKMqAoz6dT+5UE8Qvur0WE2PYAV4x+pPzZceM9fyKDsCW9gGweNW544LSrRDYRZCQBffMeuvlfLHKwppWJFap875BI8rrgxpoI44/u9jMVnX6dFuXDYOoWp4nucaI8dncpMC5mD4CkHLrDUCNyuSa3GCK9QtNzkPvMZZRY9AOTfqt50dtCZlbwLGig840d1v0mAy53X0AgODUuxTlCbV7aI/NT1MLwZA/x3JjcDasY26fTKx5L+je72Ei1H7wg0eU5uSalJLIU1ktDiQ2n/M71Q0g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TgGJxtlyVN9YZ2AXuaeLhgvrEFZT3k4314+VywTXaOw=; b=vxH2xjCvByYCb/+eMvoMMbwzMqA0Z6fXF4qKMOJ5ZRPy6+G7CNzsQGvttQDkJ1AECMQW6+W5GAq5sQcWITTP/n88163jMwblvkQ57GbWyD9Bh7mi4EulYF+0cpCmRxW2DS6tGhudOWWyHCRceUeEyyY1E8idSEX41Q4gzsbAfJc= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by CH0PR10MB4986.namprd10.prod.outlook.com (2603:10b6:610:c7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.11; Mon, 7 Feb 2022 08:24:52 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::e5a5:8f49:7ec4:b7b8]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::e5a5:8f49:7ec4:b7b8%5]) with mapi id 15.20.4951.018; Mon, 7 Feb 2022 08:24:52 +0000 Date: Mon, 7 Feb 2022 11:24:39 +0300 From: Dan Carpenter To: Andrew Lunn , Tobias Waldekranz Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, Russell King Subject: [PATCH 2/2 net-next] net: dsa: mv88e6xxx: Unlock on error in mv88e6xxx_port_bridge_join() Message-ID: <20220207082439.GB28514@kili> Content-Disposition: inline In-Reply-To: <20220207082253.GA28514@kili> X-Mailer: git-send-email haha only kidding User-Agent: Mutt/1.10.1 (2018-07-13) X-ClientProxiedBy: ZR0P278CA0056.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::7) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52cf6b9f-feb8-441d-ea34-08d9ea135064 X-MS-TrafficTypeDiagnostic: CH0PR10MB4986:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:88; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Hbtww/kbBd9Fqk54zTipdPH2Xl3YPnZvODgkkxNerAz14+5MQlcB+OEFcroTYw74jLQlk198w4qsumQkKdOuFmf3m0v+PiKavmxkXOc1Os8k2QYU6l4DOjiKtp4SrJMDWOLuQ5A1kHzl1Vky2N469EGZfAWpgrzFLldGCBRFnTsTw6Za8XcjmLYzAVJic4JKU5e7sP4jJX85dhUeqXBhENnP4mpANv4StHhosm+DEWX7HyJcySpZmnZ4A5ioQVLU3UxepP9HqROGQEsN/8sutFY6sbdWINT9NbedAW8Q9qty/r9c1YXeW6ZCk2vKstqlKTISc/37kZi0gv4CzqImaJDaao1uTLXoTDi3J/UDrqMBKfoG/sr9+nK6QvVzbcRRbi68JqWdBS8uV9hhojo8SbY2zFsAwGtWsOqLDHVqpZJTYEm667K9nS1sSsRVh/2e8P51SEfiI8nKLsVmjby5jJDb8F9nPHToJs/uYAUOES5VgDkb7vxfjFKDYV3H2z5adA00g6oXwccqaBL+tginfRxyrSsD3k/KuBrnPtoo8e8rhkCn5GZT8EIdfVtx1Mrd+rHUMhCy+Auh+wsb1n5VmRAw67Kexbd6QsXpLIiTtgCN/U8P/iFDxNK8qQkNiLFyHpDmYTu6IDnj+Z9fkFGpziN3LFijt+V9gytlivprxkTGdblbguvNkZyW0HzDOMTz94BXfMb7OvZ5+kQfjJa3xQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(7916004)(366004)(33716001)(8936002)(4744005)(4326008)(33656002)(66946007)(66476007)(8676002)(66556008)(110136005)(54906003)(316002)(508600001)(6512007)(9686003)(7416002)(44832011)(5660300002)(52116002)(6506007)(6486002)(6666004)(2906002)(1076003)(186003)(26005)(38350700002)(38100700002)(83380400001)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: u6lgiin1F2gIBDJbQ7V/zKReyrvPWtDgpTYdoB8vXO9R9djidAJZdjxDJilNyqGrE6lQn6JuFIp1v7oYKfl/JxDPaN9xOLfxLCesXdhX2V8VqDK0cOydZvMh/aPmo4YQvnkMwdt+whRVPBKV5pVF1T+43fXn+VlYNOHJkG58AMsUnYlJ4NNOSyHaWpUBMHmJ8XEpbWMUsxYKSx7dt7fJhryOh/fGyuAavqZY1kEvqabJu8htB58NXDjfpeRN9AA6ZA6OlcNS5znoPNRDPbDObH24gtf3bmrfyGaQJEldtCAOOoFzFaYFGL8X8Js/h9MRYj3SlgOBlfJz7GqvS9E/N34X6XY9Qzvr+Ci7x+mpTJz6Is2/YYfJE+o8Cj9DPKntbu9gm31YPfGuflYRQARs8JmRRFkicf//uV6VHylEEwVEloTz07MS1+PnYGWtwqx5CNQDg+9jn8O3+8exmE5YkPJ8VHvAk8iuh5PEhA1YCeillvyZ/tIB/B1EG6LBm2uYHy+ra4R32ZlweREja4ICZFY+5K7yuiZifVHyUBWjTc4lAhcmySTPO47a/cSTeY0hYFESX/8cuPiysahgmCx3nSwfmhK1dbzZ1fyAkUgsWGVTrcxbw/VvIbXzO5+bkztWQgXwU57reyyL9eV+dqE6wcWa9YIyCeR5R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d-ea34-08d9ea135064 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2022 08:24:52.5111 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: i6s2jv3ZZ3zOzbfePjwCvG+ENXsoW6lpIG2Z+8fEOJP7tz6OQAS51sqtTCfoTQ3kDx67zORCuUAK9p/C+tyEemPRjFI+Fk2rRY2HswTJVh8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB4986 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10250 signatures=673430 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 bulkscore=0 phishscore=0 malwarescore=0 mlxlogscore=999 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202070054 X-Proofpoint-ORIG-GUID: aKysWuD0-aEcaXluSOsn-_AcZUSJkZAk X-Proofpoint-GUID: aKysWuD0-aEcaXluSOsn-_AcZUSJkZAk Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Call mv88e6xxx_reg_unlock(chip) before returning on this error path. Fixes: 7af4a361a62f ("net: dsa: mv88e6xxx: Improve isolation of standalone ports") Signed-off-by: Dan Carpenter --- drivers/net/dsa/mv88e6xxx/chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 192a7688b4df..c54649c4c3a0 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c @@ -2602,7 +2602,7 @@ static int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, err = mv88e6xxx_port_set_map_da(chip, port, true); if (err) - return err; + goto unlock; err = mv88e6xxx_port_commit_pvid(chip, port); if (err)