]> git.karo-electronics.de Git - linux-beck.git/commitdiff
USB: mon_stat.c: move assignment out of if () block
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Apr 2015 09:32:58 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 10 May 2015 14:01:11 +0000 (16:01 +0200)
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>
Reviewed-by: Felipe Balbi <balbi@ti.com>
drivers/usb/mon/mon_stat.c

index ebd6189a5014ec2beff3580c0b98c3e61d140134..5388a339cfb81ba76852fc2948a7ea14060c0089 100644 (file)
@@ -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;