]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
usb: cdns3: remove redundant assignment to ret on error exit path
authorColin Ian King <colin.king@canonical.com>
Mon, 2 Sep 2019 18:43:34 +0000 (19:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 3 Sep 2019 13:46:46 +0000 (15:46 +0200)
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>
drivers/usb/cdns3/gadget.c

index ddac638f0409892304d10aae1348bcce77920de3..9536908aabb48c9bae7954f972980330a751995d 100644 (file)
@@ -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;