Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1080239ybt; Wed, 1 Jul 2020 18:20:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxG8NYO9f0hf04nMIVKnN+eXMXXRYpcBqrvlnoKGxBNLWQjhqcdGrtAa9CAwye8DUc1JgWu X-Received: by 2002:a17:906:c10f:: with SMTP id do15mr26654886ejc.249.1593652813950; Wed, 01 Jul 2020 18:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593652813; cv=none; d=google.com; s=arc-20160816; b=W6/XInPEMzZ5Gt7LYN5+Pz6M9NHHo4QmXs3U9LmevRbJIv/XPJadzi7rO5Wm/4lVrv K5fiotDRl0yKFT5Fh2qAXptG9gdv1AA52Ul78EpG70fF1FIb0/OleCiziuahIHXRVXJc fE+N74iqz/YstDrc4c+bwH8MP9mSnaFaJIdRIiTMOi7a3TGgh/AYp9uu6SxOmGyZSwNR zFTjXpuy87QmgLBp4q+TLNBL3eMgHvxTMFWbuf5Jw47IozceYK9AaQaTLqZruaQV7Wcs vA933aCDTmHftwuJ3sU8b2vLjSQMJjY9+BJUm06LpX6enkZK++4atxH2Ix1gHfGs9qTS r3cQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=ThRvVhavVm61grDLxSO4BujYLHBvIO3jK6esxNp8Wjk=; b=WseqgWzZ1Av7qMKAA0zhqOOaIP16QnjoyTUk8zzvELEiJ0RLEqSK3ZmN0pncwW+aMo o3IWUJ2UFuezi4hBbsUG7QSr5aVqJMJyKkGGHN1RVWtAU+Y1YTx5MqSlTMc/tbthBlYg hivKSl8Sd9zpfz2ZOBCLhT+3lzok6qVJUjb6hshD76o/XVHVjYqKEr9HL/klIbKznzYj pv/8bfi8/tVAk3M9Uq7jm1MAOuZ6HZ4tLmJM8PqN9pEuiIHYINXnDHsNTMHbFPZOVoZ5 ex0tlU0c/8oNyUqgMTy+svN36aSOewgviw/Ri4sKCOEnaXO9u+SodkqIdE6ql2XMuYDL Jp+g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fi17si4596855ejb.724.2020.07.01.18.19.48; Wed, 01 Jul 2020 18:20:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbgGBBSi (ORCPT + 99 others); Wed, 1 Jul 2020 21:18:38 -0400 Received: from mail.loongson.cn ([114.242.206.163]:48038 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726985AbgGBBSi (ORCPT ); Wed, 1 Jul 2020 21:18:38 -0400 Received: from [10.130.0.52] (unknown [113.200.148.30]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9AxL+jhNf1ezChOAA--.6943S3; Thu, 02 Jul 2020 09:18:26 +0800 (CST) Subject: Re: [PATCH v4 02/14] irqchip/csky-apb-intc: Fix potential resource leaks To: Markus Elfring , Thomas Gleixner , Jason Cooper , Marc Zyngier , Guo Ren , linux-csky@vger.kernel.org References: <1593569786-11500-1-git-send-email-yangtiezhu@loongson.cn> <1593569786-11500-3-git-send-email-yangtiezhu@loongson.cn> <564ffff9-6043-7191-2458-f425dd8d0c11@web.de> <1a0e007a-db94-501b-4ab9-0bb479ec093b@loongson.cn> <971c649e-fe07-3771-6fea-f5aaeaf090ad@web.de> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org From: Tiezhu Yang Message-ID: Date: Thu, 2 Jul 2020 09:18:25 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <971c649e-fe07-3771-6fea-f5aaeaf090ad@web.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9AxL+jhNf1ezChOAA--.6943S3 X-Coremail-Antispam: 1UD129KBjvJXoWxJrWDXF1fCrWDCrykXry3XFb_yoW8Gry3pF WUurn8uFZ5Jr18urnruw4kZ345Z3y2grsF93WxGrn7Zr48Wrn8Wr1kXFn0vF4DCrnrXa1r uan3A34rC3W5tFJanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvIb7Iv0xC_KF4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Cr0_Gr1UM28EF7xvwV C2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l5I8CrVAC Y4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r106r15McIj6I8E87Iv67AKxVWUJV W8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IY64vIr41lc7I2V7IY0VAS07AlzVAYIcxG 8wCY02Avz4vE14v_KwCF04k20xvY0x0EwIxGrwCFx2IqxVCFs4IE7xkEbVWUJVW8JwC20s 026c02F40E14v26r1j6r18MI8I3I0E7480Y4vE14v26r106r1rMI8E67AF67kF1VAFwI0_ Jw0_GFylIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWUCwCI42IY6xIIjxv20x vEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6Fyj6rWUJwCI42IY6I8E87Iv 67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf 9x07jUNVgUUUUU= X-CM-SenderInfo: p1dqw3xlh2x3gn0dqz5rrqw2lrqou0/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/01/2020 09:04 PM, Markus Elfring wrote: >> If remove the local variable "ret", it will look like this: > … >> +++ b/drivers/irqchip/irq-csky-apb-intc.c > … >> @@ -118,18 +116,23 @@ ck_intc_init_comm(struct device_node *node, struct device_node *parent) > … >> - ret = irq_alloc_domain_generic_chips(root_domain, 32, 1, >> + if (irq_alloc_domain_generic_chips(root_domain, 32, 1, >> "csky_intc", handle_level_irq, >> - IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN, 0, 0); >> - if (ret) { >> + IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN, 0, 0)) { >> pr_err("C-SKY Intc irq_alloc_gc failed.\n"); > … > > I suggest to recheck the parameter alignment for such a function call. > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=7c30b859a947535f2213277e827d7ac7dcff9c84#n93 OK, thank you, like this: - ret = irq_alloc_domain_generic_chips(root_domain, 32, 1, - "csky_intc", handle_level_irq, - IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN, 0, 0); - if (ret) { + if (irq_alloc_domain_generic_chips(root_domain, 32, 1, + "csky_intc", handle_level_irq, + IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN, 0, 0)) { pr_err("C-SKY Intc irq_alloc_gc failed.\n"); - return -ENOMEM; + goto err_domain_remove; } > > Regards, > Markus