Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9049474rwr; Thu, 11 May 2023 09:17:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6+dY62yjHlxw3GBt/mIxmtjIvebaINqDsH5lgOJzVsGmyYseEzqaFfIre2ugLUqwc5bvqu X-Received: by 2002:a17:902:d2c9:b0:1ac:7245:ba55 with SMTP id n9-20020a170902d2c900b001ac7245ba55mr16783381plc.6.1683821825168; Thu, 11 May 2023 09:17:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683821825; cv=none; d=google.com; s=arc-20160816; b=EdCMgG9OX1bAZ4lGIGUE+nwBt6GtvvrfJl6osoMLKfgV9AXnhxacbBpvOhew4d12nI J2lW0XjsfsB/wc2/mf2sjgMZVoioMr2r4+FfkggRAdXgiYvYuMFAByQx9EB60yJukKS4 ZvKU2og+yDTICeiG+Uqe8RxdmXHChF4SWwzJdevUUYVleAv1Siq9fTBUxBrk4AxwO/TE XXI1reVPJcbqlLVN3i7hauSgMTK0T2p6wt8IL7xJajZRDvQpF5Ro+qSbeB6pylfOsFrR 36KRp5M65Od5d8RhKfIhXlPTqLDtSqPHyDtpphudahLWv73KFkjO7llttWbr1Nc9BWiz Bq7A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:content-language:references:cc:to:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=duV+nCYJXFPsFI+ME89bWAxQgRCmS5HbuqUoeK3A3cU=; b=Yt3jjDD1Z/82rmf5XKz94qYZKjCHTP1vjrJe9mmqGERBb3lD+eMpRUSeeglARHz9K0 kz0P1VXZ1D7wlveuG0Mdlk7D2N5+OKtugmPmsNVS4PebWolsnF8a7sKRrfofLiGkKnjH mODvSqs/nGATlJWXmbDU9R9+nF2ZVCQSzyh6NdYod9uKWw5T4Fnj5l/r6b4pXVHNEXZf I1jVotEkMJ2qo6Rb/+D9++AOEh4xY79abOCMrkDdFy+mMnzPTRnCx/VYb+YREeXOPO5w oceBxolG2QCtnTlTAEeMoZc2smCvHRB01g2eNY4pAnUBXVbK/KW7O0+wb+f6xe2Q/3mv nuuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=l6yXOKZH; 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=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk15-20020a17090b224f00b0025026c97f40si17509969pjb.145.2023.05.11.09.16.50; Thu, 11 May 2023 09:17:05 -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=@gmx.de header.s=s31663417 header.b=l6yXOKZH; 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=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238517AbjEKQAw (ORCPT + 99 others); Thu, 11 May 2023 12:00:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232006AbjEKQAu (ORCPT ); Thu, 11 May 2023 12:00:50 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0992F40E7; Thu, 11 May 2023 09:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1683820542; i=deller@gmx.de; bh=hOxitp/yaN+69Px02kO6cECAR4+bMiAqGcDDxqr5bj4=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=l6yXOKZHiIm0r5i3aB2VqyGZ6FuFRvtQYKlkazZt+BMEEiCtluT0fIJqlgCBk043R mWg99aCTX7wBfotON0L+6tMKq/aErO5mfCEWPLVRpiuJ71pyBflp1FCJEYlCJf9Caq a/6wh8GFGxE2ZO7H0SVlRGNGI17x0BLHH2syt8i8VfqCTyTReq1di9VJfniRBjVUJZ oa56VC14pOGYEfaciSzV48cAbYidst77uhPN4bvEE/Y1tNtcEhGPuDSKW4ia0Ac/ko VM57mr/EMj9/Ge45vTDbTDlw+USWhobidTnDdVQAMHB02xosXEU8EIEyPJR346pqDm XyUvOjkMbrjzA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.60] ([94.134.146.253]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N5VD8-1qHjVs0yja-0170TE; Thu, 11 May 2023 17:55:42 +0200 Message-ID: Date: Thu, 11 May 2023 17:55:39 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH] drivers: fbdev: arcfb: Fix error handling in arcfb_probe() To: Zongjie Li , Andrew Morton Cc: hust-os-kernel-patches@googlegroups.com, Dongliang Mu , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20230509112727.3899-1-u202112089@hust.edu.cn> Content-Language: en-US From: Helge Deller In-Reply-To: <20230509112727.3899-1-u202112089@hust.edu.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:nvQGXvbSKhOGnAlC8Od/eLS2GcfsQZ1vvzME7KQ87ecMofiVpZX SyeEslrtNOhQytv9cNg74BGJvt+mH/zcr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mV+xVc67xn/qlOQXqFs0+v+K9CdMDTNyVnadkIw35pFp2TKQEto6s85It+ 6MaG7MpiKBDi048Ah+/VTdpRu3I= X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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: X-Mailing-List: linux-kernel@vger.kernel.org On 5/9/23 13:27, Zongjie Li wrote: > Smatch complains that: > arcfb_probe() warn: 'irq' from request_irq() not released on lines: 587. > > Fix error handling in the arcfb_probe() function. If IO addresses are > not provided or framebuffer registration fails, the code will jump to > the err_addr or err_register_fb label to release resources. > If IRQ request fails, previously allocated resources will be freed. > > Fixes: 1154ea7dcd8e ("[PATCH] Framebuffer driver for Arc LCD board") > Signed-off-by: Zongjie Li > Reviewed-by: Dongliang Mu applied. Thanks! Helge > --- > drivers/video/fbdev/arcfb.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/drivers/video/fbdev/arcfb.c b/drivers/video/fbdev/arcfb.c > index 45e64016db32..024d0ee4f04f 100644 > --- a/drivers/video/fbdev/arcfb.c > +++ b/drivers/video/fbdev/arcfb.c > @@ -523,7 +523,7 @@ static int arcfb_probe(struct platform_device *dev) > > info =3D framebuffer_alloc(sizeof(struct arcfb_par), &dev->dev); > if (!info) > - goto err; > + goto err_fb_alloc; > > info->screen_base =3D (char __iomem *)videomemory; > info->fbops =3D &arcfb_ops; > @@ -535,7 +535,7 @@ static int arcfb_probe(struct platform_device *dev) > > if (!dio_addr || !cio_addr || !c2io_addr) { > printk(KERN_WARNING "no IO addresses supplied\n"); > - goto err1; > + goto err_addr; > } > par->dio_addr =3D dio_addr; > par->cio_addr =3D cio_addr; > @@ -551,12 +551,12 @@ static int arcfb_probe(struct platform_device *dev= ) > printk(KERN_INFO > "arcfb: Failed req IRQ %d\n", par->irq); > retval =3D -EBUSY; > - goto err1; > + goto err_addr; > } > } > retval =3D register_framebuffer(info); > if (retval < 0) > - goto err1; > + goto err_register_fb; > platform_set_drvdata(dev, info); > fb_info(info, "Arc frame buffer device, using %dK of video memory\n", > videomemorysize >> 10); > @@ -580,9 +580,12 @@ static int arcfb_probe(struct platform_device *dev) > } > > return 0; > -err1: > + > +err_register_fb: > + free_irq(par->irq, info); > +err_addr: > framebuffer_release(info); > -err: > +err_fb_alloc: > vfree(videomemory); > return retval; > }