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: <F5D084D6342F9B479C34599BB0A03E4D01284E9569@AVMB1.qlogic.org>
Date:	Tue, 27 May 2014 05:01:24 +0000
From:	Saurav Kashyap <saurav.kashyap@...gic.com>
To:	Benoit Taine <benoit.taine@...6.fr>,
	Chad Dupuis <chad.dupuis@...gic.com>,
	Giridhar Malavali <giridhar.malavali@...gic.com>,
	Saurav Kashyap <saurav.kashyap@...gic.com>
CC:	"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 7/18] qla2xxx: Use kmemdup instead of kmalloc + memcpy

Acked-by: Saurav Kashyap <saurav.kashyap@...gic.com>



>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/qla2xxx/qla_mbx.c |    3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/drivers/scsi/qla2xxx/qla_mbx.c
>b/drivers/scsi/qla2xxx/qla_mbx.c
>index 7f39e36..1c33a77 100644
>--- a/drivers/scsi/qla2xxx/qla_mbx.c
>+++ b/drivers/scsi/qla2xxx/qla_mbx.c
>@@ -1319,7 +1319,7 @@ qla2x00_get_node_name_list(scsi_qla_host_t *vha,
>void **out_data, int *out_len)
> 
> 		left = 0;
> 
>-		list = kzalloc(dma_size, GFP_KERNEL);
>+		list = kmemdup(pmap, dma_size, GFP_KERNEL);
> 		if (!list) {
> 			ql_log(ql_log_warn, vha, 0x1140,
> 			    "%s(%ld): failed to allocate node names list "
>@@ -1328,7 +1328,6 @@ qla2x00_get_node_name_list(scsi_qla_host_t *vha,
>void **out_data, int *out_len)
> 			goto out_free;
> 		}
> 
>-		memcpy(list, pmap, dma_size);
> restart:
> 		dma_free_coherent(&ha->pdev->dev, dma_size, pmap, pmap_dma);
> 	}
>

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