aboutsummaryrefslogtreecommitdiffstats
path: root/0036-mon_stat.c-move-assignment-out-of-if-block.patch
diff options
Diffstat (limited to '0036-mon_stat.c-move-assignment-out-of-if-block.patch')
-rw-r--r--0036-mon_stat.c-move-assignment-out-of-if-block.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/0036-mon_stat.c-move-assignment-out-of-if-block.patch b/0036-mon_stat.c-move-assignment-out-of-if-block.patch
new file mode 100644
index 00000000000000..c831e083acde08
--- /dev/null
+++ b/0036-mon_stat.c-move-assignment-out-of-if-block.patch
@@ -0,0 +1,32 @@
+From 912396218c26521b94c90db5ef54ee1ebb829a42 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Wed, 29 Apr 2015 16:22:38 +0200
+Subject: [PATCH 36/36] mon_stat.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_stat.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/usb/mon/mon_stat.c b/drivers/usb/mon/mon_stat.c
+index ebd6189a5014..5388a339cfb8 100644
+--- a/drivers/usb/mon/mon_stat.c
++++ b/drivers/usb/mon/mon_stat.c
+@@ -28,7 +28,8 @@ static int mon_stat_open(struct inode *inode, struct file *file)
+ struct mon_bus *mbus;
+ struct snap *sp;
+
+- if ((sp = kmalloc(sizeof(struct snap), GFP_KERNEL)) == NULL)
++ sp = kmalloc(sizeof(struct snap), GFP_KERNEL);
++ if (sp == NULL)
+ return -ENOMEM;
+
+ mbus = inode->i_private;
+--
+2.3.7
+