aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2019-09-02 19:43:34 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-03 15:46:46 +0200
commit4d2233ecec8e5e2ac3e2efd5bf8fdfaf1dab30d9 (patch)
tree6c08be9642b8e335bfbbe30c9d1433d0c4bade1f /drivers/usb
parentusb: typec: tps6598x: Fix build error without CONFIG_REGMAP_I2C (diff)
downloadlinux-dev-4d2233ecec8e5e2ac3e2efd5bf8fdfaf1dab30d9.tar.xz
linux-dev-4d2233ecec8e5e2ac3e2efd5bf8fdfaf1dab30d9.zip
usb: cdns3: remove redundant assignment to ret on error exit path
In the case where an allocation fails for priv_ep ret is assigned -ENOMEM and the code exits via the exit path 'err'. The exit path returns -ENOMEM without using variable ret, so the assingment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Link: https://lore.kernel.org/r/20190902184334.27406-1-colin.king@canonical.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/cdns3/gadget.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index ddac638f0409..9536908aabb4 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -2445,10 +2445,8 @@ static int cdns3_init_eps(struct cdns3_device *priv_dev)
priv_ep = devm_kzalloc(priv_dev->dev, sizeof(*priv_ep),
GFP_KERNEL);
- if (!priv_ep) {
- ret = -ENOMEM;
+ if (!priv_ep)
goto err;
- }
/* set parent of endpoint object */
priv_ep->cdns3_dev = priv_dev;