mirror of
				git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
				synced 2025-11-01 09:13:37 +00:00 
			
		
		
		
	dmaengine: imx-sdma: sdma_get_firmware does not need to copy fw_name
It does not need to allocate space and copy fw_name in function sdma_get_firmware(). Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Vinod Koul <vinod.koul@intel.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Acked-by: Vinod Koul <vinod.koul@intel.com>
This commit is contained in:
		
							parent
							
								
									62550cd7c0
								
							
						
					
					
						commit
						40ad5b3791
					
				
					 1 changed files with 2 additions and 10 deletions
				
			
		| 
						 | 
				
			
			@ -1126,22 +1126,14 @@ static int __init sdma_get_firmware(struct sdma_engine *sdma,
 | 
			
		|||
		const char *fw_name)
 | 
			
		||||
{
 | 
			
		||||
	const struct firmware *fw;
 | 
			
		||||
	char *fwname;
 | 
			
		||||
	const struct sdma_firmware_header *header;
 | 
			
		||||
	int ret;
 | 
			
		||||
	const struct sdma_script_start_addrs *addr;
 | 
			
		||||
	unsigned short *ram_code;
 | 
			
		||||
 | 
			
		||||
	fwname = kasprintf(GFP_KERNEL, "%s", fw_name);
 | 
			
		||||
	if (!fwname)
 | 
			
		||||
		return -ENOMEM;
 | 
			
		||||
 | 
			
		||||
	ret = request_firmware(&fw, fwname, sdma->dev);
 | 
			
		||||
	if (ret) {
 | 
			
		||||
		kfree(fwname);
 | 
			
		||||
	ret = request_firmware(&fw, fw_name, sdma->dev);
 | 
			
		||||
	if (ret)
 | 
			
		||||
		return ret;
 | 
			
		||||
	}
 | 
			
		||||
	kfree(fwname);
 | 
			
		||||
 | 
			
		||||
	if (fw->size < sizeof(*header))
 | 
			
		||||
		goto err_firmware;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue