mirror of
				https://github.com/smaeul/u-boot.git
				synced 2025-11-03 21:48:15 +00:00 
			
		
		
		
	lib: sparse: Fix error checking for write_sparse_chunk_raw
The return value of write_sparse_chunk_raw is unsigned, so the existing
check has no effect. Use IS_ERR_VALUE to detect error instead, which is
what write_sparse_chunk_raw does itself.
Fixes: 62649165cb0 ("lib: sparse: Make CHUNK_TYPE_RAW buffer aligned")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/u-boot/1b323ec3-59b0-490b-a2f0-fd961dafcf49@moroto.mountain/
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240201181851.221701-1-sean.anderson@seco.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
			
			
This commit is contained in:
		
							parent
							
								
									ec19e11373
								
							
						
					
					
						commit
						766f04a297
					
				@ -211,7 +211,7 @@ int write_sparse_image(struct sparse_storage *info,
 | 
			
		||||
 | 
			
		||||
			blks = write_sparse_chunk_raw(info, blk, blkcnt,
 | 
			
		||||
						      data, response);
 | 
			
		||||
			if (blks < 0)
 | 
			
		||||
			if (IS_ERR_VALUE(blks))
 | 
			
		||||
				return -1;
 | 
			
		||||
 | 
			
		||||
			blk += blks;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user