lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190524060026.3763-2-nishkadg.linux@gmail.com>
Date:   Fri, 24 May 2019 11:30:26 +0530
From:   Nishka Dasgupta <nishkadg.linux@...il.com>
To:     gregkh@...uxfoundation.org, colin.king@...onical.com,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Cc:     Nishka Dasgupta <nishkadg.linux@...il.com>
Subject: [PATCH 2/2] staging: gdm724x: Remove variable

The return variable is used only twice (in two different branches), and
both times it is assigned the same constant value. These can therefore
be merged into the same assignment, placed at the point that both
these branches (and no other) go to. The return variable itself can be
removed.
Issue found with Coccinelle.

Signed-off-by: Nishka Dasgupta <nishkadg.linux@...il.com>
---
 drivers/staging/gdm724x/gdm_usb.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/gdm724x/gdm_usb.c b/drivers/staging/gdm724x/gdm_usb.c
index d023f83f9097..8145ae2afba7 100644
--- a/drivers/staging/gdm724x/gdm_usb.c
+++ b/drivers/staging/gdm724x/gdm_usb.c
@@ -295,7 +295,6 @@ static void release_usb(struct lte_udev *udev)
 
 static int init_usb(struct lte_udev *udev)
 {
-	int ret = 0;
 	int i;
 	struct tx_cxt *tx = &udev->tx;
 	struct rx_cxt *rx = &udev->rx;
@@ -326,7 +325,6 @@ static int init_usb(struct lte_udev *udev)
 	for (i = 0; i < MAX_NUM_SDU_BUF; i++) {
 		t_sdu = alloc_tx_sdu_struct();
 		if (!t_sdu) {
-			ret = -ENOMEM;
 			goto fail;
 		}
 
@@ -337,7 +335,6 @@ static int init_usb(struct lte_udev *udev)
 	for (i = 0; i < MAX_RX_SUBMIT_COUNT * 2; i++) {
 		r = alloc_rx_struct();
 		if (!r) {
-			ret = -ENOMEM;
 			goto fail;
 		}
 
@@ -349,7 +346,7 @@ static int init_usb(struct lte_udev *udev)
 	return 0;
 fail:
 	release_usb(udev);
-	return ret;
+	return -ENOMEM;
 }
 
 static int set_mac_address(u8 *data, void *arg)
-- 
2.19.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ