Skip to content

Commit

Permalink
USB: usbip: Remove an unnecessary goto
Browse files Browse the repository at this point in the history
When udc_dev = NULL, it is not necessary to goto out to return, just
return NULL directly. And the out goto label can be removed.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>
Link: https://lore.kernel.org/r/20230805045631.1858638-1-ruanjinjie@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Ruan Jinjie authored and Greg Kroah-Hartman committed Aug 8, 2023
1 parent a647b41 commit af6248a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/usbip/vudc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ struct vudc_device *alloc_vudc_device(int devid)

udc_dev = kzalloc(sizeof(*udc_dev), GFP_KERNEL);
if (!udc_dev)
goto out;
return NULL;

INIT_LIST_HEAD(&udc_dev->dev_entry);

Expand All @@ -503,7 +503,6 @@ struct vudc_device *alloc_vudc_device(int devid)
udc_dev = NULL;
}

out:
return udc_dev;
}

Expand Down

0 comments on commit af6248a

Please sign in to comment.