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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3FC4AB8B47ECD546BCD4B361A64BEACD8C6AE268@avmb3.qlogic.org>
Date:	Tue, 27 May 2014 08:38:21 +0000
From:	Vikas Chaudhary <vikas.chaudhary@...gic.com>
To:	Benoit Taine <benoit.taine@...6.fr>
CC:	Dept-Eng iSCSI Driver <Dept-iSCSIDriver@...gic.com>,
	"James E.J. Bottomley" <JBottomley@...allels.com>,
	linux-scsi <linux-scsi@...r.kernel.org>,
	linux-kernel <linux-kernel@...r.kernel.org>,
	"kernel-janitors@...r.kernel.org" <kernel-janitors@...r.kernel.org>
Subject: Re: [PATCH 4/18] qla4xxx: Use kmemdup instead of kmalloc + memcpy



On 26/05/14 8:51 pm, "Benoit Taine" <benoit.taine@...6.fr> wrote:

>This issue was reported by coccicheck using the semantic patch
>at scripts/coccinelle/api/memdup.cocci
>
>Signed-off-by: Benoit Taine <benoit.taine@...6.fr>
>---
>Tested by compilation without errors.
>
> drivers/scsi/qla4xxx/ql4_os.c |    7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
>diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
>index 9eef7d4..3202063 100644
>--- a/drivers/scsi/qla4xxx/ql4_os.c
>+++ b/drivers/scsi/qla4xxx/ql4_os.c
>@@ -3565,14 +3565,13 @@ static int qla4xxx_copy_from_fwddb_param(struct
>iscsi_bus_flash_session *sess,
> 	if (test_bit(OPT_IPV6_DEVICE, &options)) {
> 		conn->ipv6_traffic_class = fw_ddb_entry->ipv4_tos;
> 
>-		conn->link_local_ipv6_addr = kzalloc(IPv6_ADDR_LEN, GFP_KERNEL);
>+		conn->link_local_ipv6_addr = kmemdup(
>+					fw_ddb_entry->link_local_ipv6_addr,
>+					IPv6_ADDR_LEN, GFP_KERNEL);
> 		if (!conn->link_local_ipv6_addr) {
> 			rc = -ENOMEM;
> 			goto exit_copy;
> 		}
>-
>-		memcpy(conn->link_local_ipv6_addr,
>-		       fw_ddb_entry->link_local_ipv6_addr, IPv6_ADDR_LEN);
> 	} else {
> 		conn->ipv4_tos = fw_ddb_entry->ipv4_tos;
> 	}

Acked-by: Vikas Chaudhary <vikas.chaudhary@...gic.com>
 

--
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