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]
Date:	Sat, 7 Nov 2015 23:13:57 -0600
From:	Timur Tabi <timur@...eaurora.org>
To:	Sinan Kaya <okaya@...eaurora.org>, dmaengine@...r.kernel.org,
	cov@...eaurora.org, jcm@...hat.com
Cc:	agross@...eaurora.org, linux-arm-msm@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org,
	Vinod Koul <vinod.koul@...el.com>,
	Dan Williams <dan.j.williams@...el.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3 3/4] dmaselftest: add memcpy selftest support functions

Sinan Kaya wrote:

> +static int dma_selftest_sg(struct dma_device *dmadev,
> +			struct dma_chan *dma_chanptr, u64 size,
> +			unsigned long flags)
> +{
> +	dma_addr_t src_dma, dest_dma, dest_dma_it;
> +	u8 *dest_buf;
> +	u32 i, j = 0;
> +	dma_cookie_t cookie;
> +	struct dma_async_tx_descriptor *tx;
> +	int err = 0;
> +	int ret;
> +	struct sg_table sg_table;
> +	struct scatterlist	*sg;
> +	int nents = 10, count;
> +	bool free_channel = 1;

Booleans are either 'true' or 'false'.

> +static int dma_selftest_mapsngle(struct device *dev)
> +{
> +	u32 buf_size = 256;
> +	char *src;
> +	int ret = -ENOMEM;
> +	dma_addr_t dma_src;
> +
> +	src = kmalloc(buf_size, GFP_KERNEL);
> +	if (!src)
> +		return -ENOMEM;
> +
> +	strcpy(src, "hello world");

kstrdup()?

And why kmalloc anyway?  Why not leave it on the stack?

	char src[] = "hello world";

?


-- 
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the
Code Aurora Forum, hosted by The Linux Foundation.
--
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