aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <[email protected]>2015-04-30 11:32:53 +0200
committerGreg Kroah-Hartman <[email protected]>2015-05-10 16:01:10 +0200
commitd544d273f398a40f71012cfd165dba6ef73690c9 (patch)
treebfca760c889e17972bcc12802ae6da5f5f890416
parentc688d6211f57e1f6f8aaae5522a9223247febbd6 (diff)
USB: hub.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. Acked-by: Alan Stern <[email protected]> CC: Dan Williams <[email protected]> CC: Petr Mladek <[email protected]> CC: Peter Chen <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Reviewed-by: Felipe Balbi <[email protected]>
-rw-r--r--drivers/usb/core/hub.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 52178bc69297..50da096313e1 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -795,7 +795,8 @@ int usb_hub_clear_tt_buffer(struct urb *urb)
* since each TT has "at least two" buffers that can need it (and
* there can be many TTs per hub). even if they're uncommon.
*/
- if ((clear = kmalloc (sizeof *clear, GFP_ATOMIC)) == NULL) {
+ clear = kmalloc(sizeof *clear, GFP_ATOMIC);
+ if (clear == NULL) {
dev_err (&udev->dev, "can't save CLEAR_TT_BUFFER state\n");
/* FIXME recover somehow ... RESET_TT? */
return -ENOMEM;