mirror of
				https://xff.cz/git/u-boot/
				synced 2025-10-30 18:05:48 +01:00 
			
		
		
		
	mtd: spi_flash_free()
dfu_free_entities() invoking dfu_free_entity_sf() has let to segementation faults due to double freeing the same device. spi_flash_free() is not relevant for the driver model but exists only for compatibility with old drivers. We must not remove any device here: * The device may still be referenced. * We don't want to have to probe again. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
This commit is contained in:
		
				
					committed by
					
						 Simon Glass
						Simon Glass
					
				
			
			
				
	
			
			
			
						parent
						
							619a81516d
						
					
				
				
					commit
					b09c74f66d
				
			| @@ -46,11 +46,6 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, | ||||
| 	return dev_get_uclass_priv(dev); | ||||
| } | ||||
|  | ||||
| void spi_flash_free(struct spi_flash *flash) | ||||
| { | ||||
| 	device_remove(flash->spi->dev, DM_REMOVE_NORMAL); | ||||
| } | ||||
|  | ||||
| int spi_flash_probe_bus_cs(unsigned int busnum, unsigned int cs, | ||||
| 			   unsigned int max_hz, unsigned int spi_mode, | ||||
| 			   struct udevice **devp) | ||||
|   | ||||
| @@ -97,7 +97,9 @@ struct spi_flash *spi_flash_probe(unsigned int bus, unsigned int cs, | ||||
| 				  unsigned int max_hz, unsigned int spi_mode); | ||||
|  | ||||
| /* Compatibility function - this is the old U-Boot API */ | ||||
| void spi_flash_free(struct spi_flash *flash); | ||||
| static inline void spi_flash_free(struct spi_flash *flash) | ||||
| { | ||||
| } | ||||
|  | ||||
| static inline int spi_flash_read(struct spi_flash *flash, u32 offset, | ||||
| 				 size_t len, void *buf) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user