lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <157425606182.12247.5210659654791287522.tip-bot2@tip-bot2>
Date:   Wed, 20 Nov 2019 13:21:01 -0000
From:   "tip-bot2 for Markus Elfring" <tip-bot2@...utronix.de>
To:     linux-tip-commits@...r.kernel.org
Cc:     Markus Elfring <elfring@...rs.sourceforge.net>,
        Marc Zyngier <maz@...nel.org>,
        Lokesh Vutla <lokeshvutla@...com>,
        Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
        linux-kernel@...r.kernel.org
Subject: [tip: irq/core] irqchip/ti-sci-inta: Use ERR_CAST inlined function
 instead of ERR_PTR(PTR_ERR(...))

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     761becb29183c4e2ad9ff5f63933170c8fffd544
Gitweb:        https://git.kernel.org/tip/761becb29183c4e2ad9ff5f63933170c8fffd544
Author:        Markus Elfring <elfring@...rs.sourceforge.net>
AuthorDate:    Tue, 05 Nov 2019 12:19:39 +01:00
Committer:     Marc Zyngier <maz@...nel.org>
CommitterDate: Mon, 11 Nov 2019 10:19:06 

irqchip/ti-sci-inta: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))

A coccicheck run provided information like the following.

drivers/irqchip/irq-ti-sci-inta.c:250:9-16: WARNING: ERR_CAST can be used
with vint_desc.

Generated by: scripts/coccinelle/api/err_cast.cocci

Thus adjust the exception handling in one if branch.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
Signed-off-by: Marc Zyngier <maz@...nel.org>
Reviewed-by: Lokesh Vutla <lokeshvutla@...com>
Link: https://lore.kernel.org/r/776b7135-26af-df7d-c3a9-4339f7bf1f15@web.de
---
 drivers/irqchip/irq-ti-sci-inta.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/irqchip/irq-ti-sci-inta.c b/drivers/irqchip/irq-ti-sci-inta.c
index ef4d625..8f6e6b0 100644
--- a/drivers/irqchip/irq-ti-sci-inta.c
+++ b/drivers/irqchip/irq-ti-sci-inta.c
@@ -246,8 +246,8 @@ static struct ti_sci_inta_event_desc *ti_sci_inta_alloc_irq(struct irq_domain *d
 	/* No free bits available. Allocate a new vint */
 	vint_desc = ti_sci_inta_alloc_parent_irq(domain);
 	if (IS_ERR(vint_desc)) {
-		mutex_unlock(&inta->vint_mutex);
-		return ERR_PTR(PTR_ERR(vint_desc));
+		event_desc = ERR_CAST(vint_desc);
+		goto unlock;
 	}
 
 	free_bit = find_first_zero_bit(vint_desc->event_map,
@@ -259,6 +259,7 @@ alloc_event:
 	if (IS_ERR(event_desc))
 		clear_bit(free_bit, vint_desc->event_map);
 
+unlock:
 	mutex_unlock(&inta->vint_mutex);
 	return event_desc;
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ