Message ID | 20230329171824.1159104-1-harshit.m.mogalapalli@oracle.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp579345vqo; Wed, 29 Mar 2023 10:35:50 -0700 (PDT) X-Google-Smtp-Source: AKy350avHE1mudXVTQgjPFXMd5/ccelo/YaYgJjK3qAGf3K8Z9IuG2/1Qi+JDIkqhOGkt39CoFdc X-Received: by 2002:a17:906:2db2:b0:92b:f0d9:15f3 with SMTP id g18-20020a1709062db200b0092bf0d915f3mr3013574eji.37.1680111350221; Wed, 29 Mar 2023 10:35:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680111350; cv=none; d=google.com; s=arc-20160816; b=d3WTPOQx5DxAob6Cz27rn5IvXTP1mhRP5hMTNF5jLUHQ/j4DWq3ZEICQ3ZJbkg//wX ytjPrkueellIVUIG1W1rnCvZrH169zExi2RMmqV+9N25LQ1YbcUwxRgpZzPms2OQSLaX VZdr0PtOk554IsPx+ktPLCLuq1N2M+nN/h2lZLCtG0Q3AgrHpcfeOwSVZ/1yz+2Lo3uM /cnAUTVSSr4LmA5kNoG445qB0e05ArpHvlbFpkzfSqQ/WFAoV/3Y3UvgQ3SWYrL1/LOY C6Rdh4uA8yuI5YdMUFtew7pY8q8aI7wUpAD/zoTcHMlRT1up0gzlQ1tNZqRYP4o0z1Me 51UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=t/0QbHu+15DDjdJ84oDWMlTeOUNp+zL4KU3YLoJgJ9g=; b=z8Y4iBb6Z5YXQUTYUvb2NKXhUsxWCmYl7BHauAC8bbpApVl4IB20SANBO8LYh9oqKv DlRX78BBQUQX/PgDf7yu01MOPb1MHjBolHWsCMYvwPGILhOkijce+ENVvBAmcAUN/1m+ eTTn5/nQr+MfXx62moTvqSjBvAGgD04K9YQ1vFg+wMRJVB+jpbXzRJnty0LR3ln4F/Bn Dm8ixk/GapCAWoNC4pmCusNrXlt0ORUwZvZvx0wPxE9XhHWRD/bQIY6hK03JxFqyrm9j 7YygY5wjRdWiaCWxUQRuRvGsXPzTbaYoBR6zawTFUK5yDo1hzDiJTnE84q7bsbTHAiPq G3Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=R92p0SoO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l23-20020a056402029700b00501da1bc72csi24276124edv.521.2023.03.29.10.35.26; Wed, 29 Mar 2023 10:35:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=R92p0SoO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230130AbjC2RTI (ORCPT <rfc822;rua109.linux@gmail.com> + 99 others); Wed, 29 Mar 2023 13:19:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230037AbjC2RTG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 29 Mar 2023 13:19:06 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4939211D for <linux-kernel@vger.kernel.org>; Wed, 29 Mar 2023 10:19:04 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32TDbAhF005664; Wed, 29 Mar 2023 17:18:58 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2022-7-12; bh=t/0QbHu+15DDjdJ84oDWMlTeOUNp+zL4KU3YLoJgJ9g=; b=R92p0SoOO1+F4Z+bKD7ad7VhsrOldSqpEGJjXnNQrMkmo9VcRNVt7eKf4NUpy3nzr2te RMtLrhxAzAlv0eKPUn+oIUangaUjsi/nOSL/VsdbYHBCZT+fkmaT97XKtOu930W60arJ INd9NYTv5lt//2HJCXG97JwiMBgRVytZHZXwdE/JuURp/B1nPHr/l4MzBKxSj0pa3G07 gkTEOBjbA1wID99ZBzF/ln2rWrVElGqcfGpn+lSmmh/gfwKzFUImzN3KsOpSw7FUa5JB lkAP8nd8jTPw6wwKGv62Fn62Hzcc9Am/6I7tNmUGFfQ0y38G/PsHpmFfIhqRhmzr+c3f 7w== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pmpc90r5t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Mar 2023 17:18:58 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 32TFuqGg010803; Wed, 29 Mar 2023 17:18:57 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3phqdenf5b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 Mar 2023 17:18:57 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32THG3co015574; Wed, 29 Mar 2023 17:18:56 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3phqdenes7-1; Wed, 29 Mar 2023 17:18:55 +0000 From: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> To: emma@anholt.net, eric@anholt.net, tom.cooksey@arm.com Cc: error27@gmail.com, daniel@ffwll.ch, airlied@gmail.com, linus.walleij@linaro.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Subject: [PATCH] drm/pl111: Fix missing unwind goto in pl111_amba_probe() Date: Wed, 29 Mar 2023 10:18:24 -0700 Message-Id: <20230329171824.1159104-1-harshit.m.mogalapalli@oracle.com> X-Mailer: git-send-email 2.40.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-29_10,2023-03-28_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2303290136 X-Proofpoint-GUID: Esn5KF0L_UECQiRYu3PaMGNfcep5gPIH X-Proofpoint-ORIG-GUID: Esn5KF0L_UECQiRYu3PaMGNfcep5gPIH X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761724438769787717?= X-GMAIL-MSGID: =?utf-8?q?1761724438769787717?= |
Series |
drm/pl111: Fix missing unwind goto in pl111_amba_probe()
|
|
Commit Message
Harshit Mogalapalli
March 29, 2023, 5:18 p.m. UTC
Smatch reports:
drivers/gpu/drm/pl111/pl111_drv.c:300
pl111_amba_probe() warn: missing unwind goto?
When devm_request_irq() returns non-zero value, we need to drop the
reference for drm device and also release reserved memory which is
done in "dev_put" label. So instead of directly returning, goto dev_put
to fix this bug.
Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
---
This is based on static analysis, Only Compile tested.
---
drivers/gpu/drm/pl111/pl111_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> writes: > Smatch reports: > drivers/gpu/drm/pl111/pl111_drv.c:300 > pl111_amba_probe() warn: missing unwind goto? > > When devm_request_irq() returns non-zero value, we need to drop the > reference for drm device and also release reserved memory which is > done in "dev_put" label. So instead of directly returning, goto dev_put > to fix this bug. > > Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") > Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> > --- > This is based on static analysis, Only Compile tested. > --- > drivers/gpu/drm/pl111/pl111_drv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) The patch looks correct to me. Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c index 4b2a9e9753f6..72c5d3681b47 100644 --- a/drivers/gpu/drm/pl111/pl111_drv.c +++ b/drivers/gpu/drm/pl111/pl111_drv.c @@ -297,7 +297,7 @@ static int pl111_amba_probe(struct amba_device *amba_dev, variant->name, priv); if (ret != 0) { dev_err(dev, "%s failed irq %d\n", __func__, ret); - return ret; + goto dev_put; } ret = pl111_modeset_init(drm);