diff options
Diffstat (limited to '0018-usbatm.c-move-assignment-out-of-if-block.patch')
| -rw-r--r-- | 0018-usbatm.c-move-assignment-out-of-if-block.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/0018-usbatm.c-move-assignment-out-of-if-block.patch b/0018-usbatm.c-move-assignment-out-of-if-block.patch new file mode 100644 index 00000000000000..3c69e9173df15f --- /dev/null +++ b/0018-usbatm.c-move-assignment-out-of-if-block.patch @@ -0,0 +1,43 @@ +From d920ae9726cfa2552f91845e7acd5b97797d7bed Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Wed, 29 Apr 2015 16:22:12 +0200 +Subject: [PATCH 18/36] 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> +--- + drivers/usb/atm/usbatm.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c +index dada0146cd7f..db322d9ccb6e 100644 +--- a/drivers/usb/atm/usbatm.c ++++ b/drivers/usb/atm/usbatm.c +@@ -382,7 +382,8 @@ static void usbatm_extract_one_cell(struct usbatm_data *instance, unsigned char + "%s: got packet (length: %u, pdu_length: %u, vcc: 0x%p)", + __func__, length, pdu_length, vcc); + +- if (!(skb = dev_alloc_skb(length))) { ++ skb = dev_alloc_skb(length); ++ if (!skb) { + if (printk_ratelimit()) + atm_err(instance, "%s: no memory for skb (length: %u)!\n", + __func__, length); +@@ -816,7 +817,8 @@ static int usbatm_atm_open(struct atm_vcc *vcc) + goto fail; + } + +- if (!(new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL))) { ++ new = kzalloc(sizeof(struct usbatm_vcc_data), GFP_KERNEL); ++ if (!new) { + atm_err(instance, "%s: no memory for vcc_data!\n", __func__); + ret = -ENOMEM; + goto fail; +-- +2.3.7 + |
