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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1330047536-3827-3-git-send-email-djpohly@gmail.com>
Date:	Thu, 23 Feb 2012 20:38:49 -0500
From:	"Devin J. Pohly" <djpohly@...il.com>
To:	gregkh@...uxfoundation.org
Cc:	linux-kernel@...r.kernel.org, "Devin J. Pohly" <djpohly@...il.com>
Subject: [PATCH 2/9] mei: factor some bits of code outside if blocks

From: "Devin J. Pohly" <djpohly@...il.com>

Signed-off-by: Devin J. Pohly <djpohly@...il.com>
---
 drivers/staging/mei/interrupt.c |   15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/mei/interrupt.c b/drivers/staging/mei/interrupt.c
index 4914589..d1291ae 100644
--- a/drivers/staging/mei/interrupt.c
+++ b/drivers/staging/mei/interrupt.c
@@ -1336,9 +1336,6 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
 			}
 			ret = _mei_irq_thread_cmpl(dev, slots, pos, cl,
 					cmpl_list);
-			if (ret)
-				return ret;
-
 		} else if (cl == &dev->iamthif_cl) {
 			/* IAMTHIF IOCTL */
 			dev_dbg(&dev->pdev->dev, "complete amthi write cb.\n");
@@ -1352,11 +1349,9 @@ static int mei_irq_thread_write_handler(struct mei_io_list *cmpl_list,
 			}
 			ret = _mei_irq_thread_cmpl_iamthif(dev, slots, pos, cl,
 						cmpl_list);
-			if (ret)
-				return ret;
-
 		}
-
+		if (ret)
+			return ret;
 	}
 	return 0;
 }
@@ -1523,13 +1518,11 @@ irqreturn_t mei_interrupt_thread_handler(int irq, void *dev_id)
 			 * start sending messages.
 			 */
 			mei_host_start_message(dev);
-			mutex_unlock(&dev->device_lock);
-			return IRQ_HANDLED;
 		} else {
 			dev_dbg(&dev->pdev->dev, "FW not ready.\n");
-			mutex_unlock(&dev->device_lock);
-			return IRQ_HANDLED;
 		}
+		mutex_unlock(&dev->device_lock);
+		return IRQ_HANDLED;
 	}
 	/* check slots avalable for reading */
 	slots = mei_count_full_read_slots(dev);
-- 
1.7.9.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ