Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: usbatm.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.

CC: Duncan Sands <duncan.sands@free.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Reviewed-by: Felipe Balbi <balbi@ti.com>

+4 -2
+4 -2
drivers/usb/atm/usbatm.c
··· 382 382 "%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", 383 383 __func__, length, pdu_length, vcc); 384 384 385 - if (!(skb = dev_alloc_skb(length))) { 385 + skb = dev_alloc_skb(length); 386 + if (!skb) { 386 387 if (printk_ratelimit()) 387 388 atm_err(instance, "%s: no memory for skb (length: %u)!\n", 388 389 __func__, length); ··· 817 816 goto fail; 818 817 } 819 818 820 - if (!(new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) { 819 + new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL); 820 + if (!new) { 821 821 atm_err(instance, "%s: no memory for vcc_data!\n", __func__); 822 822 ret = -ENOMEM; 823 823 goto fail;