diff options
Diffstat (limited to '0024-inode.c-move-assignment-out-of-if-block.patch')
| -rw-r--r-- | 0024-inode.c-move-assignment-out-of-if-block.patch | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/0024-inode.c-move-assignment-out-of-if-block.patch b/0024-inode.c-move-assignment-out-of-if-block.patch new file mode 100644 index 00000000000000..772c326ca30977 --- /dev/null +++ b/0024-inode.c-move-assignment-out-of-if-block.patch @@ -0,0 +1,45 @@ +From d6c11e0e4a89f6c5e5b941cd170c3166d72b40e5 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Wed, 29 Apr 2015 16:22:24 +0200 +Subject: [PATCH 24/36] inode.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: Felipe Balbi <balbi@ti.com> +CC: Al Viro <viro@zeniv.linux.org.uk> +CC: Christoph Hellwig <hch@lst.de> +CC: Peter Chen <peter.chen@freescale.com> +CC: Alan Stern <stern@rowland.harvard.edu> +CC: Andrzej Pietrasiewicz <andrzej.p@samsung.com> +CC: Paul Bolle <pebolle@tiscali.nl> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/usb/gadget/legacy/inode.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c +index 2030565c6789..f454c7af489c 100644 +--- a/drivers/usb/gadget/legacy/inode.c ++++ b/drivers/usb/gadget/legacy/inode.c +@@ -769,9 +769,12 @@ ep_config (struct ep_data *data, const char *buf, size_t len) + if (data->dev->state == STATE_DEV_UNBOUND) { + value = -ENOENT; + goto gone; +- } else if ((ep = data->ep) == NULL) { +- value = -ENODEV; +- goto gone; ++ } else { ++ ep = data->ep; ++ if (ep == NULL) { ++ value = -ENODEV; ++ goto gone; ++ } + } + switch (data->dev->gadget->speed) { + case USB_SPEED_LOW: +-- +2.3.7 + |
