From patchwork Fri Oct 14 09:25:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 13006841 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 13B31C4332F for ; Fri, 14 Oct 2022 09:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=1CjY/J6t9aNzylZ14oHC4BOGqsnpUGuw6MzNIEZL8iQ=; b=pYL7Mo58xcf+Uf EKuCXedov9EUSOD6rMOhibr7bSz7TCAIbS48Kw+hjNL7ik/03WOuwzvPbPM1oLItdZJwldGZ9n494 XF324XP7SEBOkKg+CLO61xOdWT0uUjfZVmgebBx69WTAGJ1UbgKNrDakLHWGp9eOnVkbOGg7JPtRN Jp+VmERsliFaqbpC04jRHHtTXdO7h/eYU+g2XniOtPO/QB/uofm3/7LCU6EJuEMIBvDk0sQwYjQOt YHgtUO3lTaEYGnwcSHDYibYvHecwhqZQXcZs2W0NGuDBEQQSFa622b0WwnMOV093c297T1sMKFi49 BE4svy/81IDal9XRSSMQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojGwu-00ECuV-DK; Fri, 14 Oct 2022 09:25:48 +0000 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojGwm-00ECtP-WC for linux-phy@lists.infradead.org; Fri, 14 Oct 2022 09:25:45 +0000 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29E8YriI028241; Fri, 14 Oct 2022 09:25:18 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-2022-7-12; bh=u3ZNqRHmLgFeef4loJ3XPFpW0SyOlDX/XSsqF2UdPxg=; b=DeDE9bqBdstSRv/a781XAb/UQvVN9lBnrQ2W4Sxtdou/xg2h6he3f2qkX1OeC6ipfVwX i0Co+zMsIicmQiex1Lz+H5m3rgBexzvHPfHEA9Iq1OHjMSyk4rQs22TKv14mQfe0lpTA mgHatTOVGNITxABq2OyXU6ushcB3cUZqt97/oIoIx261htyVmDjfRuGZ2T1QsgUd/tNe 1a7cRb6UubehLuyP/LdixYPzhnoOepvtl2pk3kt1MZcDmesOnvLLuMzcV3HVVx+GddOj C03k/v+nsuXhRAzUoj/Zm01yBOpcng86AObMU4tJS3Zt2iHguLTXdb4AQIHwnN+yRZ0U dw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3k73ncr817-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Oct 2022 09:25:18 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 29E70alt020891; Fri, 14 Oct 2022 09:25:17 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2041.outbound.protection.outlook.com [104.47.51.41]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3k2yn6shap-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 14 Oct 2022 09:25:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ghkGcNJ/8jZ+Tx7L/ag6KXLsaJJP+LpuFB7BTLBxZHrrnEvt3/aD8FjgUWC2uHvwRZvL27NBOY4Rxl+M+bTp2KJdTpAkUirzeYC/oADDs0Nva08TJ4FdzG0al38uRC/91+69C/TjafzKNNjYzHcgFk9CN01TB6f9QMJdoXYcwyQKfJbkejK/8WCpQx3qSv0tKJe4ZGftnL67O1CjO3KqnQUeT2YBhGnZa2Lcfhyp/ibLiRCkPf9CNJu7vD3gf2DmqcMa71WpUAucv0dri0dPVALdQ8bQZI1h5QUUaMdzGnFOWZmMgzQkJQq11CMsVENhO56tOFv+V1erRbUcT6YyiA== 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=u3ZNqRHmLgFeef4loJ3XPFpW0SyOlDX/XSsqF2UdPxg=; b=KTeXbkje4AuDNMHoq3L/R15VyDnDLR/sVkCox7XL/Ywbo/Lek5HXGqu9Bk4JbuOZRNlUGMaeiupIjUwtbSbBEDPxjjrPEeOOg9ecSNzndOHT+s+aW66DqBGgaiUY7H4QcHKv0u7Z2QoOAMtHw7AS12CC+mDGNlVsGoLB4Aw4C4/2i0ipxaxS7UwMzFS31l5R/LJauaHlHrrWIAj0/xrmYyGX9ABuvDqWllsOyQvb+1kq7Ijpd0E+3w9h23nXL1ld614iOrwrY41sdlO85aUkWiqjiTG/mM5eRqdJwaTQD6uWtKoJ2Z8vXbdUDRf+e6vvBqH1a3yiX5KV7RtlVa/4rA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; 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=u3ZNqRHmLgFeef4loJ3XPFpW0SyOlDX/XSsqF2UdPxg=; b=IkrKupaLNYE2+2Im/E9pfqqg3+vJo6EFls1qT72wHP+aGFbhr+ignBtGfDgAbnWJTLHNcVi/XKlVLM/kCicjLT+5JM/3Eq+10SzIrg6reoQexUZ89QgHEpy9pNWVMGKzid8IcT6491sQ+qEBL5b3T/pWLRa5udKppHFmd2sZPdo= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by SJ0PR10MB5568.namprd10.prod.outlook.com (2603:10b6:a03:3d3::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.23; Fri, 14 Oct 2022 09:25:15 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::1b8e:540e:10f0:9aec]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::1b8e:540e:10f0:9aec%4]) with mapi id 15.20.5676.031; Fri, 14 Oct 2022 09:25:15 +0000 Date: Fri, 14 Oct 2022 12:25:06 +0300 From: Dan Carpenter To: Kishon Vijay Abraham I Cc: Vinod Koul , Maxime Coquelin , Alexandre Torgue , Amelie Delaunay , Fabrice Gasnier , linux-phy@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, kernel-janitors@vger.kernel.org Subject: [PATCH] phy: stm32: fix an error code in probe Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0173.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:45::8) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR1001MB2365:EE_|SJ0PR10MB5568:EE_ X-MS-Office365-Filtering-Correlation-Id: 688b6eaf-9efe-4451-2f34-08daadc60060 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u2dMuGJxidbeNUGMWDf+PHPLEcgMJGMH+AyT1EmOLxF3czopKIuogK8o9FVgqGvfta2PlHpvgZ95GKdMqp6NT0XUKK3N87CM0PAdkOWv6x4pAtRAA89pMAhxMws7bUUSsRgn8cZ0Ds5GJI3MpIbHjOXZxYWzUTF+S7V9WcHk36B9Asi+YK12e66spLn+LRzm4o174l4mrotC3yTVgX4dXPURp6ax3ahHBdemo0W4b1/XwOmHiyLtB7tfKUleZct88uryFnUPI2sdCXFoQzM9IiHT5CaFVeK88L2em14oN7J2Vm74YN34++Jeeicc7SGdnbawspMmUGZTGN0JQroD150B0bMj1uQekwsDXKK7rhAqJs8ITFtqBoZ5HDDMa2xF0o/DatWk/yxfdeYFwDfmFSLuNnMJNXonYDDc8SlzMvbrqhZ+gCgSE4lP0/iCcKOsMrTuLqytCEVNsldu2VJg2QX/3lItysFEh32Ud65Ca1Op7bsW+QTp2oa+nGdtCOTfQN0SpRrR6mWJ0zwBtjlZgtXVDgJgPBUuPmeYXdwEGdXLQFBy/ZLohDxBPC5p2GkaPM+99+qGehhUz/E9W5CTpVvjCt1MyM5e3bW7hSeN6TUafUXjktvSK5fNX7qcpfmvN4Q8djFAVSbijXmgSQZo32Y+U7Juz06Zk4ZMKdQR6aM+tHZRM+srDGxA3CgaiNRsFBn7jKIcyBylAaQsr1HFbcn41mHjZQOCpF1WPrE5JbsjtgrpLo3LcBePV+BaBrNM 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:(13230022)(7916004)(136003)(346002)(376002)(39860400002)(366004)(396003)(451199015)(4326008)(41300700001)(66946007)(66556008)(5660300002)(66476007)(44832011)(8676002)(186003)(4744005)(9686003)(8936002)(6512007)(26005)(6666004)(33716001)(478600001)(2906002)(6506007)(6486002)(38100700002)(54906003)(316002)(86362001)(6916009)(67856001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Vs+6JPC+gay69h/nV+uYAU2cGic6Uo9odcjJ1850QU7zxxGd447CQbk2Daev1+zNRujt6wrHySl6hPPr4yXn5fnD1UC1yKOwoNLY98QVjvpjbmPo5/zE/ZNyNBYbJw7L8jEFkjrzO+5iTRVmSftANitUdyxtCr6KDOeEmdIooKMYutNvAiuPIssFkoO9oaFvPuj4+hVw0Lg1Xp3+81y+xSiwIB0yHXKNlwz5GSRkJOgoK356geRPyo+97FuTsZ+OaI2OQk6Ab4cgS0koJgO2f9PGVWFLKOMhRv5tIatfclKwBeUXfRNHu+Gyxg3vkbe+D7fmmQLxWwWCR0HVUtji8BEUUyKmnSouptGvygw3kiPHXSnhYryKKc+zKj0qyEMQOW3fmRLlpcIb8+5ZGVdclMKoJc5KKc53Cw8y6/e9gXNmltw4YDV8UHos+C70CAibIBkpvsrkkgv6mkASeO+Ja05QiuPmN7/EMT2FZeI58pUiARyNWfe9flgl+dwdu9LkK0NNqvyBeBqB90CQsTrsP0mWvheQeNIBDCNSNXY9WYeDdFUHWciNSswCdF8RnYNms/4OB0RjT03W9XjNqS2ql3N9CEn0DCU/lm+XqOu+PaWTnMV+7MWtvTe9DYyws6ybCY/n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enant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Oct 2022 09:25:14.9811 (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: KWaJdkmho3Blbcy8UmKluXSXQ8fST52O8qKV/plxJKDVh4CP9mOjhwz6ZbbEIrIPvRti1194k+B8rJBJ7RDNTXAP8ysBCdLE/Qbj9zR0Nlg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5568 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-14_05,2022-10-13_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 adultscore=0 malwarescore=0 phishscore=0 suspectscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210140053 X-Proofpoint-GUID: zH_Cx_hDjspPwyYWSinCaAmRv1pxvXb6 X-Proofpoint-ORIG-GUID: zH_Cx_hDjspPwyYWSinCaAmRv1pxvXb6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221014_022544_823214_6FB6C879 X-CRM114-Status: GOOD ( 13.77 ) X-BeenThere: linux-phy@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux Phy Mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-phy" Errors-To: linux-phy-bounces+linux-phy=archiver.kernel.org@lists.infradead.org If "index > usbphyc->nphys" is true then this returns success but it should return -EINVAL. Fixes: 94c358da3a05 ("phy: stm32: add support for STM32 USB PHY Controller (USBPHYC)") Signed-off-by: Dan Carpenter Reviewed-by: Amelie Delaunay --- drivers/phy/st/phy-stm32-usbphyc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/phy/st/phy-stm32-usbphyc.c b/drivers/phy/st/phy-stm32-usbphyc.c index a98c911cc37a..5bb9647b078f 100644 --- a/drivers/phy/st/phy-stm32-usbphyc.c +++ b/drivers/phy/st/phy-stm32-usbphyc.c @@ -710,6 +710,8 @@ static int stm32_usbphyc_probe(struct platform_device *pdev) ret = of_property_read_u32(child, "reg", &index); if (ret || index > usbphyc->nphys) { dev_err(&phy->dev, "invalid reg property: %d\n", ret); + if (!ret) + ret = -EINVAL; goto put_child; }