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: <54D4F952.5070206@users.sourceforge.net>
Date:	Fri, 06 Feb 2015 18:26:42 +0100
From:	SF Markus Elfring <elfring@...rs.sourceforge.net>
To:	"James E. J. Bottomley" <JBottomley@...allels.com>,
	linux-scsi@...r.kernel.org
CC:	LKML <linux-kernel@...r.kernel.org>,
	kernel-janitors@...r.kernel.org,
	Julia Lawall <julia.lawall@...6.fr>
Subject: [PATCH 3/3] SCSI-debug: Fix exception handling for an alignment/granularity
 mismatch in scsi_debug_init()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 6 Feb 2015 17:57:32 +0100

The scsi_debug_init() function returned directly if the data items "alignment"
and "granularity" did not fit together.

Let us improve the affected exception handling by replacing the return
statement by a goto statement so that previously allocated resources will also
be appropriately released.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/scsi/scsi_debug.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
index 756b7be..2c78663 100644
--- a/drivers/scsi/scsi_debug.c
+++ b/drivers/scsi/scsi_debug.c
@@ -4909,7 +4909,8 @@ static int __init scsi_debug_init(void)
 		    scsi_debug_unmap_alignment) {
 			pr_err("%s: ERR: unmap_granularity <= unmap_alignment\n",
 			       __func__);
-			return -EINVAL;
+			ret = -EINVAL;
+			goto free_dif;
 		}
 
 		map_size = lba_to_map_index(sdebug_store_sectors - 1) + 1;
-- 
2.2.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ