aboutsummaryrefslogtreecommitdiffstats
path: root/0034-mon_bin.c-move-assignment-out-of-if-block.patch
diff options
Diffstat (limited to '0034-mon_bin.c-move-assignment-out-of-if-block.patch')
-rw-r--r--0034-mon_bin.c-move-assignment-out-of-if-block.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/0034-mon_bin.c-move-assignment-out-of-if-block.patch b/0034-mon_bin.c-move-assignment-out-of-if-block.patch
new file mode 100644
index 00000000000000..f3e83547d67b32
--- /dev/null
+++ b/0034-mon_bin.c-move-assignment-out-of-if-block.patch
@@ -0,0 +1,43 @@
+From 5e6c9f9aecf7e9fc69394ebfeff4b7234bd2c9d5 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed, 29 Apr 2015 16:22:34 +0200
+Subject: [PATCH 34/36] mon_bin.c: move assignment out of if () block
+
+We should not be doing assignments within an if () block
+so fix up the code to not do this.
+
+change was created using Coccinelle.
+
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/mon/mon_bin.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
+index 9a62e89d6dc0..3598f1a62673 100644
+--- a/drivers/usb/mon/mon_bin.c
++++ b/drivers/usb/mon/mon_bin.c
+@@ -675,7 +675,8 @@ static int mon_bin_open(struct inode *inode, struct file *file)
+ int rc;
+
+ mutex_lock(&mon_lock);
+- if ((mbus = mon_bus_lookup(iminor(inode))) == NULL) {
++ mbus = mon_bus_lookup(iminor(inode));
++ if (mbus == NULL) {
+ mutex_unlock(&mon_lock);
+ return -ENODEV;
+ }
+@@ -1018,8 +1019,8 @@ static long mon_bin_ioctl(struct file *file, unsigned int cmd, unsigned long arg
+ return -EINVAL;
+
+ size = CHUNK_ALIGN(arg);
+- if ((vec = kzalloc(sizeof(struct mon_pgmap) * (size/CHUNK_SIZE),
+- GFP_KERNEL)) == NULL) {
++ vec = kzalloc(sizeof(struct mon_pgmap) * (size / CHUNK_SIZE), GFP_KERNEL);
++ if (vec == NULL) {
+ ret = -ENOMEM;
+ break;
+ }
+--
+2.3.7
+